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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
mike9999
Frequent Visitor

Table.Distinct incorrect

Hi-

 

I'm running a dataflow on a PPU P1 capacity.

 

I have ~12 million rows.

 

I'm attempting a Table.Distinct on six columns of various types. I get incorrect distinct results (it removes at least a row that isn't a duplicate).

 

Table.Distinct(#"Filtered rows", {"Col1-Text", "Col2-Text", "Col3-Text", "Col4-Number", "Col5-Text", "Col6-DateTime"})

 

Per other threads I tried but this produces an out-of-memory error-

Table.Distinct(Table.Buffer(#"Filtered rows"), {"Col1-Text", "Col2-Text", "Col3-Text", "Col4-Number", "Col5-Text", "Col6-DateTime"})

 

Any suggestions? I see the recommendation that buffer is used for more consistent results but i don't think that is an option in my case.

2 ACCEPTED SOLUTIONS
Omid_Motamedise
Super User
Super User

the syntax is correct, try to group the rows based on that 6 columns and see the groups of rows that remoed wrongly this might help to descover the reason of reamoving this rows.

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h

View solution in original post

pbiuseruk
Resolver II
Resolver II

The reason you received that suggestion about the Table.Buffer is because sometimes when query folding occurs (when the query is being run at source rather than in the Power BI engine), then it can rearrange steps in order to be more efficient. Sometimes this leads to incorrect results.

Another way to stop this is to use Table.StopFolding instead of the Table.Buffer but I think you may end up getting the same message as they do near enough the same thing.

Let me know if it happens to work for you though

View solution in original post

3 REPLIES 3
pbiuseruk
Resolver II
Resolver II

The reason you received that suggestion about the Table.Buffer is because sometimes when query folding occurs (when the query is being run at source rather than in the Power BI engine), then it can rearrange steps in order to be more efficient. Sometimes this leads to incorrect results.

Another way to stop this is to use Table.StopFolding instead of the Table.Buffer but I think you may end up getting the same message as they do near enough the same thing.

Let me know if it happens to work for you though

Also, as another suggestion, could you try to concatenate those columns into one column and then do a distinct count, directly on that one column?

Omid_Motamedise
Super User
Super User

the syntax is correct, try to group the rows based on that 6 columns and see the groups of rows that remoed wrongly this might help to descover the reason of reamoving this rows.

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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