Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
User | Count |
---|---|
123 | |
69 | |
67 | |
58 | |
52 |
User | Count |
---|---|
183 | |
92 | |
67 | |
62 | |
52 |