Forum Discussion
Anonymous
1 year agoNot applicable
Conditional Formatting in Power BI Matrix Based on Dynamic KRI Status Thresholds
Hi everyone, I'm working on a Power BI report and need some help with conditional formatting in a matrix visual. I have two tables: KRI and KRI results, connected by a one-to-many relationship betwe...
Poojara_D12
1 year agoSuper User
Hi Anonymous
To dynamically format the matrix cells based on KRI thresholds:
Create a DAX Measure: Write a measure to calculate the status (Red, Orange, Yellow, Green) based on the KRI table thresholds:
Status =
VAR Value = MAX('KRI results'[Result])
VAR RedLow = LOOKUPVALUE('KRI'[Red Low], 'KRI'[ID], MAX('KRI results'[Id]))
VAR RedHigh = LOOKUPVALUE('KRI'[Red High], 'KRI'[ID], MAX('KRI results'[Id]))
-- Add similar variables for Orange, Yellow, Green
RETURN
SWITCH(
TRUE(),
Value < RedLow || Value > RedHigh, "Red",
-- Add conditions for Orange, Yellow, Green
"Green"
)
- Add to Matrix: Use the Status measure in the matrix as the Values field.
- Apply Conditional Formatting:
- Format the Title column in the matrix with conditional formatting.
- Use the Field value option and select the Status measure.
- This will color cells dynamically based on KRI-specific thresholds.
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂
Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
- Anonymous1 year agoNot applicable
Hi Poojara, again thanks for you insight but it doesn't work here for me. The boundary for red can be either <6 or >20.