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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
SruthiSVedula
New Member

Remove duplicates in direct query

Hi,

 

I am a PowerBI begginer and lot of this stuff is still new for me. Please suggest me a solution for the following issue. Thanks in Advance.

 

I initially had two tables that I merged into one in a direct query connection. This created a lot of duplicates for some reason and when I try to remove the duplicate rows ( option present in the Query Editor menu) it gives the following message,

 

"This step results in a query that is not Supported in DirectQuery mode"

 

How do I still stay in the DirectQuery mode and still remove the duplicate rows?

 

Thanks again

 

2 ACCEPTED SOLUTIONS
JayHerrera
Advocate I
Advocate I

Are you using a "union" or "union all" in your query to combine the data from two tables into one? If so, the difference between UNION and UNION ALL is that UNION ALL will bring back all records regardless and a UNION effectively does a SELECT DISTINCT on the results set. If you are querying one table, then a SELECT DISTINCT will get unique records from this table.


Reference:

https://www.google.com/search?q=SQL+union+vs+union+all&spell=1&sa=X&ved=0ahUKEwj_pqDCqPHVAhWMmbQKHd1...

View solution in original post

v-sihou-msft
Microsoft Employee
Microsoft Employee

@SruthiSVedula

 

Since you are under Direct Query mode, any transform step which can modify the source table structure is not allowed in Query Editor. So for your requirement, please custom a query and use DISTINCT keyword  to remove the duplicate rows.

 

Regards,

View solution in original post

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@SruthiSVedula

 

Since you are under Direct Query mode, any transform step which can modify the source table structure is not allowed in Query Editor. So for your requirement, please custom a query and use DISTINCT keyword  to remove the duplicate rows.

 

Regards,

JayHerrera
Advocate I
Advocate I

Are you using a "union" or "union all" in your query to combine the data from two tables into one? If so, the difference between UNION and UNION ALL is that UNION ALL will bring back all records regardless and a UNION effectively does a SELECT DISTINCT on the results set. If you are querying one table, then a SELECT DISTINCT will get unique records from this table.


Reference:

https://www.google.com/search?q=SQL+union+vs+union+all&spell=1&sa=X&ved=0ahUKEwj_pqDCqPHVAhWMmbQKHd1...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors