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
cassels
Advocate I
Advocate I

Comparison between two different tables

Hi! I'm starting with powerBI and I need help.

 

I have a database with some devices, and other department create a report (Excel from SharePoint online) with the devices that they have (report independent from SQL) from another system.

What I want to do is create a comparison between the devices that I have in database and not in excel (and vice-versa). I want to do that as a Service, to update automatically (but now I don't know how to start and do the basic comparison).

I imported the tables from SQL and the table from the spreadsheet (Excel), and now I got stocked.

 

What I want first in the report is, for example: Devices in SQL not in Excel / Devices in Excel not in SQL

The second step would be: Devices in SQL not in Excel where Position is different from "Local"

 

Someone could help me with that please?
Thanks

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

You could create a copule Merge queries to do that. So, create a new Merge query and point it to both of your existing queries and do a Right Anti and then repeat and do a Left Anti.

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

You could create a copule Merge queries to do that. So, create a new Merge query and point it to both of your existing queries and do a Right Anti and then repeat and do a Left Anti.

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi! Thank you for your help. 

 

So, I get data from SQL and Excel, and create a relationship. Now I am able to the comparison for one side filtering the blank values. The problem is that it doesn't happen the same way in the other side, and I can't figure out why.

 

If I had 'DC' with values and 'DeviceName' blank, I could do the same.

 

pbi.pngpbi2.png

 

 

 

About your solution, I will have to search how to do it. I'm new at PowerBI, but it seems to solve my problem.

 

Thank you again, I will try and let you know.

In the Query Editor on th Home tab look up in the upper right and you will see Merge Queries I would hit the arrow button and say Merge Queries as New in your case. At the bottom of the Merge Queries dialog there is an option for picking how you merge the queries together which is where you would pick Right Anti or Left Anti. Once you create the first one, just copy the query and change your Right Anti to a Left Anti.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.