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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I am putting together a P&L report where I want to display the line items in a matrix. It has a mix of percentage and currency values things like standard margin. I created a measure and wrote the following switch statement (snippet below) and I'm not getting any errors, but the values are not coming through
Solved! Go to Solution.
Hi @Anonymous ,
First of all, thanks @HotChilli for the quick reply.
You can try it.
Formatted Value2 = SUM('Merchandising P&L'[Value])
SWITCH(
SELECTEDVALUE('Merchandising P&L'[Header]),
"DC cost %", "00.00%",
"Freight cost %", "00.00%",
"G2N% (Gross Sales)", "00.00%",
"Operational Gross Margin% (COPA)", "00.00%",
"SM%", "00.00%",
"Total SM%", "00.00%",
"COS", "$0.00",
"Distribution Center Cost", "$0.00",
"FIFO", "$0.00")
'
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please feel free to let me know.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
First of all, thanks @HotChilli for the quick reply.
You can try it.
Formatted Value2 = SUM('Merchandising P&L'[Value])
SWITCH(
SELECTEDVALUE('Merchandising P&L'[Header]),
"DC cost %", "00.00%",
"Freight cost %", "00.00%",
"G2N% (Gross Sales)", "00.00%",
"Operational Gross Margin% (COPA)", "00.00%",
"SM%", "00.00%",
"Total SM%", "00.00%",
"COS", "$0.00",
"Distribution Center Cost", "$0.00",
"FIFO", "$0.00")
'
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Normally it's very hard to look at a piece of DAX and diagnose problems without a data sample or the context of the visual.
However, it looks like the generous use of FORMAT has scuppered your values, turning them into strings.
I've tried about a half dozen different things between conditional columns and I'm just not getting anywhere 😛 I saw this work on a less complex example posted elsewhere, but I'm not having any luck