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

Sort data by date and exclude duplicate data

Hi,

 

I am using a DirectQuery connection to and SQL data base that has data uploaded from clients on a montly basis.

I need to exclude data that has been uploaded in duplicate for the same time period.

 

I feel I need to sort by month, then remove the duplicate data in that time period but I am not sure how to do this.

Should I use a dax expression?  The problem being if I create a new Column I am unsure how this will effect my relational data.

 

The data is comprised of over 100 different tables that are all related, half of them  directly back to the table I need to filter.

I can not include a screen shot as it is sensitive data.

 

Thanks in advance

 

 

2 REPLIES 2
GilbertQ
Super User
Super User

Hi @KellieDaniel I would suggest adding the Calculated Column and see what happens.

 

Also in your source system is there no way in the current process, to go through and exclude or delete the duplicate data?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

@KellieDaniel My opinion would be that you clean this up in the database side of things.. If for some reason that can't be done, and it's ok to have duplicate information in the table, I would use a view to replace the Power BI Query that currently looks at the table. You said you had over a 100 tables, and I don't know where/how the relationships are so I don't know if this is a single change or something you would have to do multiple times...

Here is my thinking. You could identify the duplicates using calculated columns, but you are just adding overhead to the model. You can't remove those duplicates in PBI because you are using direct query. So by handling the problem before the data gets to PBI, you are reducing the number of records that need to be passed, and not adding unecessary bloat to your model.

Off the top of my head this would be something like using a ROW_NUMBER() function to determine how many times the given criteria duplicate, and using that as a subquery have the outer query reference that function where it equals 1. This would return the distinct list for Power BI.


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

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.