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! It's time to submit your entry. Live now!
Hi,
I would like to make a colored staircase according to the different values of my matrix :
when I have 'public stockview'[end_day_stock]) >= 0, I want the color to be green("#32CD32"),
when I have 'public red_emergency_view'[remaining stock + supply]) >= 0, I want the color to be orange ("#FFA500"),
when I have 'public red_emergency_view'[remaining stock + supply]) < 0, I want the color to be red ("#FF0000")
After several attempts, I simplified my conditions by creating a new column on PowerQuery which indicates the color that the line must take according to the conditions above
On the PowerBI side, I created a new measure :
color_measure = SWITCH(SELECTEDVALUE('fusion stockview et red_emergency_view'[couleur]), "#32CD32", "#32CD32", "#FFA500", "#FFA500", "#FF0000", "#FF0000")
Then, I performed conditional formatting on my "Stock restant" values based on the measure
However this only works if all the values in my row give the same result
- If I have 'public stockview'[end_day_stock]) >= 0 for each cell, everything is green
Same for orange and red
However in cases where several cells verify different conditions, there is no color
But according to my conditions, the cells of 23/09, 26/09, 03/10, 06/10, 07/10 and 10/10 should be red and the others orange
Thanks for help
Solved! Go to Solution.
It's works with this measure :
color_mesure = if(SUM('public stockview'[end_day_stock]) >= 0, "#32CD32", if(SUM('public red_emergency_view'[stock restant + appro]) >=0, "#FFA500", "#FF0000"))
It's works with this measure :
color_mesure = if(SUM('public stockview'[end_day_stock]) >= 0, "#32CD32", if(SUM('public red_emergency_view'[stock restant + appro]) >=0, "#FFA500", "#FF0000"))
Hi @Anonymous ,
Here I create a sample to have a test.
Measure:
Color =
VAR _VALUE = SELECTEDVALUE('Table'[Value])
RETURN
IF(_VALUE<0,"Red","Orange")
Use conditional formatting in Matrix. Result is as below.
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! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 60 | |
| 46 | |
| 30 | |
| 24 | |
| 23 |
| User | Count |
|---|---|
| 146 | |
| 108 | |
| 64 | |
| 38 | |
| 31 |