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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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