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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
deannapi
Frequent Visitor

Highlighting background comparing to total

I have a matrix built by Year-Month, Location Name, and a % value from dividing 2 measures.

I want to highlight cells per column if the cell is greater than it's total

 

The datatable looks like the following example  but with multiple years and Locations:

 

 

 

YearMonthLocationValue1Value2
2023JanuaryLocA40193714.33643966.62
2023FebruaryLocA31852406.97912116.34
2023MarchLocA35091429.05767218.08

 

Then I create a measure for Value2 / Value1

Year-MonthLocationA
20232.17%
January1.60%
February2.86%
March2.19%
Total2.17%

I now need to compare each row with it's column total:

   IF each cell is greater than the column Total, then highlight cell red

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @deannapi ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create measures.

total = CALCULATE([Measure],ALL('Table'))
color = IF([Measure]>[total],"red")

(3) Setting the Conditional Format and then the result is as follows.

vtangjiemsft_0-1709258778871.pngvtangjiemsft_1-1709258830468.pngvtangjiemsft_2-1709258840518.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @deannapi ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create measures.

total = CALCULATE([Measure],ALL('Table'))
color = IF([Measure]>[total],"red")

(3) Setting the Conditional Format and then the result is as follows.

vtangjiemsft_0-1709258778871.pngvtangjiemsft_1-1709258830468.pngvtangjiemsft_2-1709258840518.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

lbendlin
Super User
Super User

lbendlin_3-1709258291609.png

 

 

lbendlin_0-1709258178642.pnglbendlin_1-1709258217394.pnglbendlin_2-1709258232611.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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