Miscellaneous topics that do not fit into specific categories.
thank you, but I'am not getting the desire result
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm trying to add an if statement to the quick measure to basically say if the percentage is negative the text should be in red with the negative sign in front, and if its positive the number should be in green with the plus sign in front. but I keep getting an error message.
Miscellaneous topics that do not fit into specific categories.
thank you, but I'am not getting the desire result
Use the quick measure as the numeric base, then create a separate DAX measure (or visual calculation) that returns formatted text and apply conditional formatting from it.
Assume the quick measure is:
Parts % Diff =
VAR __BASELINE_VALUE = SUM('Parts'[2024 ACTUAL])
VAR __VALUE_TO_COMPARE = SUM('Parts'[2025 ACTUAL])
RETURN
DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)
Create a new measure for the signed, color-driving value:
Parts % Diff Display =
VAR v = [Parts % Diff]
RETURN
IF(
v < 0,
"-" & FORMAT( ABS(v), "0.00%" ),
"+" & FORMAT( v, "0.00%" )
)
Then:
< 0 = red, >= 0 = green. When working with percentages, enter rule values as decimals (for example, 0 and 0.25) and choose Number as the format, not Percent.If using visual calculations (preview), the same logic can be written as a visual calculation and then used as a hex color field for conditional formatting, similar to:
Parts % Diff Color =
IF( [Parts % Diff] < 0, "#E91C1C", "#5BA300" )
Set its data type to Text, hide it from the visual, and select it in the conditional formatting dialog.
References: