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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ERing
Post Partisan
Post Partisan

Conditional formatting issue with matrix visual

I have a report with a matrix visual like below where I'm showing scores for survey results. Each of the three columns in my matrix is a measure and I'm trying to add conditional formatting to the Delta column. 

My conditional formatting is set up using a Field Value based on the measure [Color_Formatting]. The 25th percentile is -8.40, so anything below that should be formatted in red.

The issue is shown in the table visual on the left which has the Score Category (Process, Skills) and the Score Subcategory in the Rows pane. On this visual the conditional formatting is incorrect. 

In the table visual on the right I removed the Score Category (Process, Skills) from the Rows Pane leaving only the Score Subcategory. In this visual, the conditional formatting is correct.

So the question is how I can correctly show the conditional formatting in the table on the left where I have Score Category (Process, Skills) and the Score Subcategory in the Rows pane.

 

Color_Formatting = IF(Delta <= [25Percentile], "Red","Black")

25Percentile = PERCENTILEX.INC(ALL('Table'[Scorecard_Subcategory]), 'Table'[Delta],.25)

Score for Opportunities Closed = 
CALCULATE(
DIVIDE(SUM(Table[Scores]),COUNT(Table[Opportunity_ID])),
KEEPFILTERS(TABLE[Closed_Flag = 1))

Score for Opportunities Not Closed = 
CALCULATE(
DIVIDE(SUM(Table[Scores]),COUNT(Table[Opportunity_ID])),
KEEPFILTERS(TABLE[Closed_Flag = 0))

Delta = [Score for Opportunities Not Closed] - [Score for Opportunities Closed]

 

1.png

1 ACCEPTED SOLUTION

@ERing  then add both dimensions to the ALLSELECTED, review the results now, image attahced.

25Percentile = PERCENTILEX.INC(ALLSELECTED('Table'[Score Subcategory],'Table'[Score Category]),
'Table'[Delta],.25)

 

fahadqadir3_1-1749610647693.png

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!

View solution in original post

4 REPLIES 4
fahadqadir3
Super User
Super User

@ERing Review the attached pbix file and screenshot.

fahadqadir3_0-1749579484495.png

Use All('Table') Instead of any specific column.

25Percentile = PERCENTILEX.INC(ALL('Table'), 'Table'[Delta],.25)

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!! 

@fahadqadir3 Thanks for your suggestion, however it does not work with my real data.

Using just 'Table' in the ALL function produces the inccorect value for the 25th percentile.

I think the issue has something to do with row context of the conditional formatting. 

The correct 25th percentile value is -36.91, so with my [Color Formatting] measure, anything below -36.91 should be red, but you can see it includes other values as well.

I've included a Sample File here if you would be able to take a look and make a reccomendation.

SAMPLE FILE 

25Percentile = PERCENTILEX.INC(ALL('Table'[Score Subcategory]),'Table'[Delta],.25)

Color Formatting = if('Table'[Delta]<='Table'[25Percentile],"Coral","LightGray")

 

ERing_1-1749594616194.png

 



 

 




@ERing  then add both dimensions to the ALLSELECTED, review the results now, image attahced.

25Percentile = PERCENTILEX.INC(ALLSELECTED('Table'[Score Subcategory],'Table'[Score Category]),
'Table'[Delta],.25)

 

fahadqadir3_1-1749610647693.png

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!

@fahadqadir3 Thanks very much! I think this works. 

One small thing I noticed is that the 25th Percentile result is slightly different when calculated from my actual data table (Table) compared to when calculated from only the numbers present in the Matrix visual.

I wanted to test the accuracy of the 25PercentileCorrect measure so I created a Test table where I input the list of Delta numbers from the matrix visual. I then created the 25PercentileTest.

The 25PercentileCorrect = PERCENTILEX.INC(ALLSELECTED('Table' [Score Category], 'Table' [Score Subcategory]),'Table [Delta], .25) produces a result of -7.29.

 

The 25PercentileTest measure which is PERCENTILE.INC('Test'[Scores],.25). produces a result of -7.30. 

I know it an insignificant difference, but I can't figure out what would cause the measures to produce a slightly different result.

Any ideas what would cause this?

 

Updated Report File 


Screenshot 2025-06-11 173656.png





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.