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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

How to Remove Duplicate Values from PowerBI Direct Query Table

Hi, 
I brought in a table from SQL database using DirectQuery (needed to solution a PowerApp inside the PBI visual).

The PBI visual is a table listing projects, each project has multiple attributes with each attribute appearing as a column in the table visual.

However, the data doesn't appear to be "clean". For example, I noticed that one project has 2 rows, every attribute about the project is identical for the 2 rows EXCEPT the Project Director name - there are 2 names, so the project appears twice (in 2 rows).

I understand that with DirectQuery you cannot create steps such as removing duplicates.
HOW can I remove duplicate records then when it is DirectQuery mode?

Thank you!

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

For long term, I would talk to your DBA to get the data in the format you need. In the short term, if you can't switch to import mode (recommended to get the flexibilty you need and improve performance), you can use the SUMMARIZE function in your measures to get the distinct combination of the fields you need (e.g., leave out the Director field).

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
mahoneypat
Microsoft Employee
Microsoft Employee

For long term, I would talk to your DBA to get the data in the format you need. In the short term, if you can't switch to import mode (recommended to get the flexibilty you need and improve performance), you can use the SUMMARIZE function in your measures to get the distinct combination of the fields you need (e.g., leave out the Director field).

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Thanks Pat. I think I will go with the DBA route, it seems cleaner. Thanks again!

danextian
Super User
Super User

Hi @Anonymous ,

 

Please try the proposed solutions in this URL: https://community.powerbi.com/t5/Desktop/Remove-duplicates-in-direct-query/m-p/238430 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.