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
Anonymous
Not applicable

Compare two columns in different tables to find non-matching and highlight text based on condition

I have these two tables (both loaded in Power Query) and displayed in Power BI as two Table visualizations:

 

Table name: Submissions

 

NameWeek Number
Trenton Espinoza42
Anahi Johns43
Max Gilbert43
Jadyn Levine44

 

Table name: Exceptions

 

NameWeek Number
Jadyn Levine45
Trenton Espinoza41
Anahi Johns43
Katherine Waters45
Jazlynn Mcclure46

 

In Power BI, i want the result to be shown in the table, Submissions, by highlighting the names based on certain conditions.

 

Result shown in Power BI in the table, Submissions:

 

NameWeek Number
Trenton Espinoza42
Anahi Johns43
Max Gilbert43
Jadyn Levine44

 

The conditions for highlighting the names in the table Submissions:

1. The names in the Submissions table not in common with the names in the Exceptions table.

2. If the names in the Submissions table is common with the names in the Exceptions table, then check if the Week Number in the Submissions table is greater than the Week Number in the Exceptions table.

 

But i would like the font colour change in the same table, Submissions, visualization in the Power BI report.

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

Try to create a measure like this:

Measure = 
var _t1=ADDCOLUMNS('Submissions',"E-WN",CALCULATE(MAX('Exceptions'[Week Number]),FILTER(ALL(Exceptions),'Exceptions'[Name]='Submissions'[Name])))
var _t2=SUMMARIZE(FILTER(_t1,[E-WN]=BLANK()||[Week Number]>[E-WN]),[Name])
var _if=IF(SELECTEDVALUE('Submissions'[Name]) in _t2, "red")

return _if

Then apply conditional formatting to the name field.

Result:

vangzhengmsft_0-1639622574165.png

 

Please refer to the attachment below for details.

Hope this helps.

 

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

1 REPLY 1
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

Try to create a measure like this:

Measure = 
var _t1=ADDCOLUMNS('Submissions',"E-WN",CALCULATE(MAX('Exceptions'[Week Number]),FILTER(ALL(Exceptions),'Exceptions'[Name]='Submissions'[Name])))
var _t2=SUMMARIZE(FILTER(_t1,[E-WN]=BLANK()||[Week Number]>[E-WN]),[Name])
var _if=IF(SELECTEDVALUE('Submissions'[Name]) in _t2, "red")

return _if

Then apply conditional formatting to the name field.

Result:

vangzhengmsft_0-1639622574165.png

 

Please refer to the attachment below for details.

Hope this helps.

 

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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