Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

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

Anonymous
Not applicable

@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.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.