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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Conditional formatting based on total column

Hi!

 

I have a matrix which looks like this:

Conditional_Formatting.PNG

The total column shows the average for the respective rows. I want to apply conditional formatting to the values based on the value in the Total Column. If the value is lower than the value in the total column it shoult be displayed in green and if it is higher it should be red. How can I achieve this?

 

Thank you! 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

You need to create a measure for the condittional formatting something similar to:

 

Coditional formatting = IF([Average]>= CALCULATE([Average];ALLSELECTED('Table'[Columns Category]));"#517d4f";"#b81818")

[Average] - Measure used for filling out the values in the matrix

If there is none create the following:
Average = Average(Table[Values])

Table[Columns Category] - the name of the column used on your columns in the matrix

 

Then use the condittional formatting Field Value and chosse the previous measure.

 

You can adjust the values in "" to the colours you want.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @Anonymous ,

 

You need to create a measure for the condittional formatting something similar to:

 

Coditional formatting = IF([Average]>= CALCULATE([Average];ALLSELECTED('Table'[Columns Category]));"#517d4f";"#b81818")

[Average] - Measure used for filling out the values in the matrix

If there is none create the following:
Average = Average(Table[Values])

Table[Columns Category] - the name of the column used on your columns in the matrix

 

Then use the condittional formatting Field Value and chosse the previous measure.

 

You can adjust the values in "" to the colours you want.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi, I need some help, I'm failing at accomplishing this simple thing in Power BI.

I have a matrix with a few columns, one of them is a measure called DSO.
I would like to color DSO based on its total. If >=total,"Red"; if < Total, "green"DSO.png

 

Thank you

Wimverh
Resolver IV
Resolver IV

you have to create a new measure, which you can use for formatting. This measure should calculate the total value, on each field on your matrix. You can achive that by the ALL function. Your screenshot does not show the measure on which the columns are based. 

let's assume that column is mydimesion[mytype], your used measure is [mymeasure]

 

your formatting measure should be

myformatting measure=
calculate([mymeasure],ALL(mydimension[mytype]))

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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