I am new to conditional formatting the format property and maybe I can't do what I am trying to do.
I have a stored procedure that contains a type field and monthly values which are formatted as money. In SSRS, I need the format property to look at the type and decide which type of formatting the number needs.
For example:
if type = % Difference, I want to format as percent with no decimal places
if type is anything other than % Difference, I want to format positive numbers like #,##0 and negative numbers like (#,##0)
I have tried many combinations in the format property expression, but this is the only one that gets me close.
=iif(Fields!Type.Value = "% Difference", Format(Fields!M2.Value, "P0"),
iif(Fields!Type.Value <> "% Difference" and Fields!M2.Value < 0, Format(Fields!M2.Value, "(#,##0)"),
iif(Fields!Type.Value <> "% Difference" and Fields!M2.Value >= 0, Format(Fields!M2.Value, "#,##0"),"")))
This formula does something strange with my numbers though. For example, one number should read 24,852,000. However, what actually shows up is 24,852,24,852,000
Any help would be greatly appreciated.
I have a stored procedure that contains a type field and monthly values which are formatted as money. In SSRS, I need the format property to look at the type and decide which type of formatting the number needs.
For example:
if type = % Difference, I want to format as percent with no decimal places
if type is anything other than % Difference, I want to format positive numbers like #,##0 and negative numbers like (#,##0)
I have tried many combinations in the format property expression, but this is the only one that gets me close.
=iif(Fields!Type.Value = "% Difference", Format(Fields!M2.Value, "P0"),
iif(Fields!Type.Value <> "% Difference" and Fields!M2.Value < 0, Format(Fields!M2.Value, "(#,##0)"),
iif(Fields!Type.Value <> "% Difference" and Fields!M2.Value >= 0, Format(Fields!M2.Value, "#,##0"),"")))
This formula does something strange with my numbers though. For example, one number should read 24,852,000. However, what actually shows up is 24,852,24,852,000
Any help would be greatly appreciated.