Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 71 | |
| 50 | |
| 47 | |
| 44 |