question

siera_gld avatar image
siera_gld asked

SSRS Conditional Formatting

I have values stored in a table that are both pct and $$ amount n in the same column. So in my report I have attempted (unsucccessfully) conditional formatting like this =iif(Fields!FIXED_AMT.Value = "True",FormatCurrency(Fields!AMT.Value),FormatPercent(Fields!AMT.Value)) so the column Fixed Amount is a bit that tells me if it is currency, if not that means it is a % in the table my value of fixed amt = 0 and amt of .15 is 15% and fixed amt = 1 and 15 = $15 but what is being rendered in ssrs is 1500% and when fixed amt = 1 it shows $6781 for what is supposed to be 6.81 Any Ideas?
ssrsformattingconditional
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Daniel Ross avatar image
Daniel Ross answered
I'm not sure why the values are going like that...it worked OK for me when I tried it out using your exact expression. Is there something in your dataset that is multiplying the AMT result by 100? You could try doing this, depends on what datatype the AMT column is though. =iif(Fields!FIXED_AMT.Value = "True",FormatCurrency(Fields!AMT.Value/100),FormatPercent(Fields!AMT.Value/100))
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Valentino Vranken avatar image
Valentino Vranken answered
Where exactly did you specify that expression? As value for your textbox, or in the Format property? (should be as value, not Format) Note also that the percentages will get multiplied by 100 as a result of the FormatPercent function: > Returns an expression formatted as a > percentage (that is, multiplied by > 100) with a trailing % character. >(ref. [FormatPercent function][1]) If the FIXED_AMT is a bit, I would write the expression as follows: =iif(Fields!FIXED_AMT.Value = 1, FormatCurrency(Fields!AMT.Value), FormatPercent(Fields!AMT.Value)) [1]: http://msdn.microsoft.com/en-us/library/8zh1kxd7%28v=vs.90%29.aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.