Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello there,
I've been using the following Switch statement measure to switch between Units and Sales Values on several parts of my report:
NAT_U_S_Selector = SWITCH( TRUE(), VALUES('Selector'[Measure]) = "Units", Facts[NAT_SumU], VALUES('Selector'[Measure]) = "Value", CURRENCY(Facts[NAT_Sum_Sales]), BLANK())
So far so good, the switch works perfect switching from Units to Value, everywhere I need.
Problem is, the value doesn't come up with the currency symbol. (Even if it is formatted has currency - Image below)
Trying to solve this, I'm trying to force "currency" on the switch statement but ... no success.
Alternatively, if I change this (NAT_U_S_Selector) measure format to currency ... everything (Units and Value) will then display with the Currency Symbol, but this is not a solution since units are units and currency is currency.
Is there any tip to show the currency symbol, using a switch?
BTW, if I use the original Facts[Nat_Sum_Sales] on a Card, without the Switch, the currency symbol is there ... So it looks like it's all about the Switch.
Many Thanks in advance,
Peter.
Solved! Go to Solution.
Instead, you could use the FORMAT Function.
https://msdn.microsoft.com/en-us/library/ee634561.aspx
@v-chuncz-msft, thanks 😉
Here it is, ugly but working. 🙂
NAT_U_S_Selector_F$ = SWITCH( TRUE(), VALUES('Selector'[Measure]) = "Units", Facts[NAT_SumU], VALUES('Selector'[Measure]) = "Value",
IF(Facts[NAT_Sum_Sales] > 1000000 , FORMAT(Facts[NAT_Sum_Sales]/1000000,"$0.00") & "M",
IF (Facts[NAT_Sum_Sales] > 1000 && (Facts[NAT_Sum_Sales]) < 999999, FORMAT(Facts[NAT_Sum_Sales]/1000,"$0.00") & "K",
IF(Facts[NAT_Sum_Sales] > 0 && Facts[NAT_Sum_Sales] < 1000, FORMAT(Facts[NT_Sum_Sales]/1,"$0"),(Facts[NAT_Sum_Sales])))), BLANK())
Instead, you could use the FORMAT Function.
https://msdn.microsoft.com/en-us/library/ee634561.aspx
@v-chuncz-msft, thanks 😉
Here it is, ugly but working. 🙂
NAT_U_S_Selector_F$ = SWITCH( TRUE(), VALUES('Selector'[Measure]) = "Units", Facts[NAT_SumU], VALUES('Selector'[Measure]) = "Value",
IF(Facts[NAT_Sum_Sales] > 1000000 , FORMAT(Facts[NAT_Sum_Sales]/1000000,"$0.00") & "M",
IF (Facts[NAT_Sum_Sales] > 1000 && (Facts[NAT_Sum_Sales]) < 999999, FORMAT(Facts[NAT_Sum_Sales]/1000,"$0.00") & "K",
IF(Facts[NAT_Sum_Sales] > 0 && Facts[NAT_Sum_Sales] < 1000, FORMAT(Facts[NT_Sum_Sales]/1,"$0"),(Facts[NAT_Sum_Sales])))), BLANK())
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |