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.
I have a matrix with this structure:
NAME Program Actual
Kpi1 | R1 | 66.5 |
Kpi1 | R2 | 43.5 |
Kpi1 | R3 | 70.9 |
Kpi2 | R1 | 2 |
Kpi3 | R2 | 2 |
Kpi4 | R3 | 3 |
Name and Program are columns, Actual is a measure.
How can I use conditional formatting for the Actual field only for the first 3 cells (when NAME = Kpi1)?, so, if ACTUAL > 80% -> green , <75 -> red, between 75-80 no color.
Solved! Go to Solution.
Add a measure to set the formatting color and check for the KPI1 row like this.
Format Color =
SWITCH (
TRUE(),
SELECTEDVALUE ( YourTable[Name] ) = "KPI1",
SWITCH(
TRUE,
[Actual] <= 75, "Red",
[Actual] >= 80, "Green"
)
)
Then apply that measure as the background color to the value:
Can you post your .pbix file (load it to drop box and share the link)? My formula works in my test.
I found the issue. For some reason i had to put <= "65%" in the measure. Thanks for your help.
@jdbuchanan71 Thanks for correcting. I missed the KPI name condition but you cannot apply conditional format on a column on the row in the matrix visual, visual still need to be changed to table visual
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Add a measure to set the formatting color and check for the KPI1 row like this.
Format Color =
SWITCH (
TRUE(),
SELECTEDVALUE ( YourTable[Name] ) = "KPI1",
SWITCH(
TRUE,
[Actual] <= 75, "Red",
[Actual] >= 80, "Green"
)
)
Then apply that measure as the background color to the value:
This is not working for me, all the rows are green even if they should not.
If your [Actual] measure is a % then you would apply it at .75 and .8 like this.
Format Color =
SWITCH (
TRUE(),
SELECTEDVALUE ( YourTable[Name] ) = "KPI1",
SWITCH(
TRUE,
[Actual] <= .75, "Red",
[Actual] >= .80, "Green"
)
)
I tried that already, it's still the same.
@savulesc you cannot use conditional formatting on a column used in the rows but if you are using table visual, you can apply conditional formatting on the column on a row. Add a new measure for conditional formatting and then use table visual and apply field value for Name column using the color measure
Color KPI =
VAR __actual = [Actual Measure]
RETURN
SWITCH ( TRUE(),
__actual > .80, "Green",
__actual < .75, "Red"
)
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
I didn't really understand your response, but I don't want to use conditional formatting on the Name column , because that doesn't help me at all.
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |