Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hey there!
I am creating a calculation item in tabular editor which is supposed to calculate the difference between two values:
VAR BASELINE_VALUE = CALCULATE ( SELECTEDMEASURE (), 'Version'[Version] = "V2" )
VAR VALUE_TO_COMPARE = CALCULATE ( SELECTEDMEASURE (), 'Version'[Version] = "V1" )
RETURN BASELINE_VALUE - VALUE_TO_COMPARE
With an Format String Expression:
SWITCH ( Numberformat[Numberformat Factor],
1, "#,0.00\ €;-#,0.00\ €;#,0.00\ €",
1000, "#,0.00\ T€;-#,0.00\ T€;#,0.00\ T€",
1000000, "#,0.00\ M€;-#,0.00\ M€;#,0.00\ M€" )
For some reason the value does not get the "€", "T€", "M€". Can anybody help with that?
When using this instead it works:
VAR BASELINE_VALUE =
CALCULATE ( SELECTEDMEASURE (), 'Version'[Version] = "V2" )
VAR VALUE_TO_COMPARE =
CALCULATE ( SELECTEDMEASURE (), 'Version'[Version] = "V1" )
RETURN FORMAT ( ( BASELINE_VALUE - VALUE_TO_COMPARE ),
SWITCH (
Numberformat[Numberformat Factor],
1, "#,0.00\ €;-#,0.00\ €;#,0.00\ €",
1000, "#,0.00\ T€;-#,0.00\ T€;#,0.00\ T€",
1000000, "#,0.00\ M€;-#,0.00\ M€;#,0.00\ M€" ) )
In my measure I have the Sum / Numberformat Factor.
Hi @Anonymous
I have a test on your sample, I think the second code will work well. Format your measure after calculation.
My easy sample:
Here is a blog about calculate group in tabular.
For reference: Introducing Calculation Groups
If this reply still couldn't help you solve your problem, please share a sample with us and show us a screenshot with the result you want.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 64 | |
| 47 | |
| 41 | |
| 36 | |
| 23 |
| User | Count |
|---|---|
| 184 | |
| 123 | |
| 106 | |
| 78 | |
| 52 |