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
Topjacket
Helper I
Helper I

Matrix conditional formatting based on comparison to overall average

Hello

 

Sorry if I have missed something but I have tried searching and figuring it out myself but I am struggling with this one.

 

I have a matrix which shows "Category" in the columns and "Employee Name" in the rows with the value showing as average of "Recorded Time" in minutes. I am trying to format the background so that if a value is -/+5% of the column average then it is coloured Amber and if it is -/+10% then it is Red.

 

I feel like this should be possible. If anyone has any tips or can point me in the right direction, that would be great.

 

Thanks in advance

 

James

1 ACCEPTED SOLUTION
pranit828
Community Champion
Community Champion

Hi @Topjacket 

Color Code = 
VAR AvgOfAll = Calculate(AVERAGE(table[value]),all(table))
Var Avg = Average(table[value])
RETURN SWITCH(TRUE,
              Avg/AvgOfAll >= 10, "Red",
              Avg/AvgOfAll >= 5 , "Amber","")

Use this measure in the conditional formatting.





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

View solution in original post

3 REPLIES 3
pranit828
Community Champion
Community Champion

Hi @Topjacket 

Color Code = 
VAR AvgOfAll = Calculate(AVERAGE(table[value]),all(table))
Var Avg = Average(table[value])
RETURN SWITCH(TRUE,
              Avg/AvgOfAll >= 10, "Red",
              Avg/AvgOfAll >= 5 , "Amber","")

Use this measure in the conditional formatting.





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Thanks very much for this.

Anonymous
Not applicable

Hello

 

Look at this subject, I think this is the same for you

https://community.powerbi.com/t5/Desktop/Conditional-formatting-matrix/m-p/2118691

James

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.