Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Conditional Formatting per row on Matrix

Hi, I have a KPI dashboard to make and was wondering if there was a way to have conditional formating per row? Each metric will have different targets and I am trying compare each target to the different results per date. Some metrics have more complex statements where it will have different targets per location as well. I have attached a picture of some dummy data that shows what I am trying to portray. Thanks!

jostho99_0-1650732525747.png

 

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

Hi jostho99

Please consider this solution and remember I am an unpaid Power BI volunteer, so click the thumbs up button if you like me helping you and the solved button if I fix your problem.

Click here for an example solution 

 

This example has the targets in table but you could hard code them in a switch statement.
A table is better because the users can edit the targets without a PBI developer changing DAX. 


Create a dax measure like this

KPI Colour =
VAR mytarget = SELECTEDVALUE(Facts[Target])
RETURN
IF(SUM(Facts[Value])> mytarget, "Red","Green")
 
Then in conditioinal formating select
Format Style = Field Value

What field should we base this on = KPI Colour

 

View solution in original post

2 REPLIES 2
speedramps
Super User
Super User

Hi jostho99

Please consider this solution and remember I am an unpaid Power BI volunteer, so click the thumbs up button if you like me helping you and the solved button if I fix your problem.

Click here for an example solution 

 

This example has the targets in table but you could hard code them in a switch statement.
A table is better because the users can edit the targets without a PBI developer changing DAX. 


Create a dax measure like this

KPI Colour =
VAR mytarget = SELECTEDVALUE(Facts[Target])
RETURN
IF(SUM(Facts[Value])> mytarget, "Red","Green")
 
Then in conditioinal formating select
Format Style = Field Value

What field should we base this on = KPI Colour

 

Im assuming the Facts[Value] is a column in the table. What is the Facts[Value] is a measure? How to change the formula?


I have a similar situtaion where I have a measure "TurnOverRate" and I used the same formula you suggested but my measure is not detectable.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.