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
mflorian
Frequent Visitor

Wrapping Distinct around a union

I have created three summary tables that pulls revenue information from three disparate systems for a consolidated report. Two of the tables have the potential for duplicate data due to a data classification problem that is currently being worked on. In the meantime, we need to create a data set for the user to report from.

 

The union statement works fine but it returns duplicate rows when the two systems have the same data. I have set all data fields for the three summaries to be the same in SSAS. When I wrap a distinct around the union, I get the same results as if the union was not there.

 

Here is the DAX:

=DISTINCT(UNION('Table A, 'Table B', 'Table C'))

 

Is there a better way to accomplish this? It seems straight forward but ... nothing ever is.

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

You may append data using Query Editor and then select all column > Right click > Remove Duplicates > Close and Load.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

You may append data using Query Editor and then select all column > Right click > Remove Duplicates > Close and Load.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

If I do remove duplicates that way, and then refresh all my union'ed data sources and add rows, etc. will the duplicates be removed on the refreshed data source as well?

Yes


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.