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

DAX or Query: Compare two columns in different Tables

 

I have 2 tables and want to compare two columns (one from each) in query editor or dax. I just need a yes they (the text values) match or no (text values) don't match in a new column. Secondly I need a count of all the orders that do not match to table 2.

 Table 1 (Primary Table)

Order NoOrder Status
1234Resolved
1235Pending
1236Open
1237Resolved
1238Resolved
1239Pending

 

Table 2

Order NoOrder Status
1234Open
1235Resolved
1236

Pending

1237Resolved
1238Resolved
1239Open

 

 

I want a new column to be created (in either table) that shows when the Order status values in rows from each table match, as below:-

Order NoOrder StatusColumn 3
1234ResolvedNo Match
1235PendingNo Match
1236OpenMatch
1237ResolvedMatch
1238ResolvedMatch
1239PendingNo Match

 

Do i need to do this as a merge query or dax ?

 

Thanks

2 ACCEPTED SOLUTIONS
aj1973
Community Champion
Community Champion

Hi @Anonymous 

here you go

aj1973_0-1625145142041.png

 

Attached the file

https://drive.google.com/file/d/1hMWpl1vwwXlj8yDKT8vmXLUF7S207jUU/view?usp=sharing

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

aj1973
Community Champion
Community Champion

Hey add this to the measure if you don<t want to count the Blank rows

Count of MisMatch = CALCULATE(COUNTROWS(OEC_Service_Requests) , OEC_Service_Requests[Match/No Match__] = "No Match", OEC_Service_Requests[Status_Code ESR] <> BLANK())

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

22 REPLIES 22

Hi @tulasi_pbi1988 

What do you mean by like this????

Please open a new thread and send me examples where I can look into your issue. Every model is unique and different.

Thanks

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Hi @aj1973 

 

Thank you for your reply.

Here is the link for a new thread.

https://community.powerbi.com/t5/Desktop/Comparing-two-tables-for-Non-Matched-and-Matched-Rows-to-sh...

 

 

 

 

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.