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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MinhPham96
Frequent Visitor

Change row color in Matrix by comparing the columns' values

Hello, so I have the following Matrix, I have two columns Forecast and Achieved. What I want is that for each row, if Achieved is >= 70% of Forecast, that row will be colored Green; else the row color will be red. I am fairly new to this so I hope I can get some help. Thank you for reading.

Capture.PNG

1 ACCEPTED SOLUTION

hi, @MinhPham96 

If so, just adjust it as below:

Step1:

Create a measure as below:

Measure = IF(CALCULATE(SUM('Table'[Actual Amount]))>=CALCULATE(SUM('Table'[Forecast Amount]))*0.7,1,2)

Step2:

Create conditional format as below:

6.JPG

7.JPG

and for your case, you need to do conditional format for each field in Values

 

and here is new sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
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

3 REPLIES 3
MinhPham96
Frequent Visitor

Hello @v-lili6-msft , thank you for your answer, but in my case, it is a bit different, here is how my table look like 

Untitled.png

 

And this is how it is presented in the matrix 

 

Capture.PNG

So when I decided to do conditional formatting, I have something like this, which I cannot use.

Capture1.PNG

Can you have a look for me, thank you very much. 

hi, @MinhPham96 

If so, just adjust it as below:

Step1:

Create a measure as below:

Measure = IF(CALCULATE(SUM('Table'[Actual Amount]))>=CALCULATE(SUM('Table'[Forecast Amount]))*0.7,1,2)

Step2:

Create conditional format as below:

6.JPG

7.JPG

and for your case, you need to do conditional format for each field in Values

 

and here is new sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lili6-msft
Community Support
Community Support

HI, @MinhPham96 

You could try this way as below:

Step1:

Create a measure by this logic:

Measure = IF(CALCULATE(SUM('Table'[Value]),'Table'[Type]="Achieved")>=CALCULATE(SUM('Table'[Value]),'Table'[Type]="Forecast")*0.7,1,2)

Step3:

Then use Conditional formatting in power bi as below:

4.JPG

Result:

5.JPG

and here is sample pbix file, please try it.

 

Regards,

Lin

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.