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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
lcharlebois
Frequent Visitor

Conditional Formatting Between Tables

Hi all,  

 

I have 2 tables in a report.  One of them is using conditional formating on a measure.  It's basically highlighting a whole row in red if a student has a failing letter grade for a course.  The table above, which is fitlering this table using interactions contains the list of students.  What I'd like is to highlight the students row in the above table if ANY of their underlying records has a failing grade. 

 

Thanks in advance.

 

Screen Shot 2020-11-04 at 2.08.30 PM.png

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

I can't give you an answer without seeing the entire model and measures. But in principle, the table at the bottom looks like it is filtered by student and course to generate the response (conditional formatting). But of course those 2 items are coming from 2 tables. If you want colour conditional formatting in the top table, you will need to embed the course filtering inside a measure. You could do that with an X function. This is illustrative only as I don't know your model. 

=MAXX(courses,IF([measure that returns course pass]=FALSE(),1,0))

 

the above measure will cycle through all courses for a student and return 1 if there is at least 1 fail and 0 if there are no fails. You could change it to SUMX instead and that would return the number of fails. This could be used to show relative performance of students. Hth



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

1 REPLY 1
MattAllington
Community Champion
Community Champion

I can't give you an answer without seeing the entire model and measures. But in principle, the table at the bottom looks like it is filtered by student and course to generate the response (conditional formatting). But of course those 2 items are coming from 2 tables. If you want colour conditional formatting in the top table, you will need to embed the course filtering inside a measure. You could do that with an X function. This is illustrative only as I don't know your model. 

=MAXX(courses,IF([measure that returns course pass]=FALSE(),1,0))

 

the above measure will cycle through all courses for a student and return 1 if there is at least 1 fail and 0 if there are no fails. You could change it to SUMX instead and that would return the number of fails. This could be used to show relative performance of students. Hth



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors