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
gauravnarchal
Post Prodigy
Post Prodigy

Compare values from 2 rows

Need help!!  How can I compare the data from two rows in a table?

 

I need to match “UnqNumber” field to find out missing "UnqNumber" in "SubmitTo" (2) of each Invoice.

 

8-13-2020 12-56-07 PM.jpg

2 ACCEPTED SOLUTIONS

One 'brute force' approach would be to seperate the base table into two in Power Query, each filtered respectively for the 1 or 2, then LEFT OUTER JOIN them together on Unique ID and look for nulls.

 

Another approach would be to create a measure that is the MAX(SubmitTo) and when you view the list by UniqueID, look for any where the MAX is 1 instead of 2.

 

I'm sure there are more ways.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





View solution in original post

v-lionel-msft
Community Support
Community Support

Hi @gauravnarchal ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1597372134784.png

 

Best regards,
Lionel Chen

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

4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @gauravnarchal ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1597372134784.png

 

Best regards,
Lionel Chen

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

amitchandak
Super User
Super User

@gauravnarchal , The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.


@amitchandak  - Each “UnqNumber” should exist twice (One as SubmitTo 1 & and other as SubmitTo 2) of each invoice no.

 

If it does not exist then it should return the Invoice as a "Missing".

 

So I wanted the measure to match/check "UnqNumber" of each Invoice with SubmitTo 1 & 2 and validate the missing.

 

I hope this makes some sense.

One 'brute force' approach would be to seperate the base table into two in Power Query, each filtered respectively for the 1 or 2, then LEFT OUTER JOIN them together on Unique ID and look for nulls.

 

Another approach would be to create a measure that is the MAX(SubmitTo) and when you view the list by UniqueID, look for any where the MAX is 1 instead of 2.

 

I'm sure there are more ways.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





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