Forum Discussion
Sort data by date and exclude duplicate data
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.