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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors