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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
aseagull
Helper IV
Helper IV

Power Query: Table.AggregateTableColumn runs infinite loop?

Hi. I hope someone can shed light on this without me trying to build a sample file. It seems absolutely bizarre to me. I have been merging queries and expanding table columns since I started in this tool a year+ ago. But I just went to aggregate a table column, and it's apparently in some kind of infinite loop: PQ tells me in the lower right that it's reading hundreds of MB of data (from a local file that is 11 MB) with no end or termination in sight.

 

But if I change from AggregateTableColumn to ExpandTableColumn, things work fine. Why is the aggregation sending me over a cliff?

 

If it helps: I'm merging a table with another where there is a many-to-many relationship (unofficially). I really just want to record the presence of a record from the first table in the second table. I was just going to aggregate and count the rows, so I could get 0, 1, 2, or maybe 3 depending on how many matches there are. I thought this was a simple thing to do? Otherwise, I'll have to create some more queries, removing dupes, appending, whatever...just seems like multiple queries and steps where AggregateTableColumn would have taken care of it very quickly.

 

Thanks for any ideas!

Amon

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

Hi @aseagull ,

I don't know why that is, but I've published a workaround for your problem here: Performance tip for aggregations after joins in Power Query and Power BI (thebiccountant.com)

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

2 REPLIES 2
ImkeF
Community Champion
Community Champion

Hi @aseagull ,

I don't know why that is, but I've published a workaround for your problem here: Performance tip for aggregations after joins in Power Query and Power BI (thebiccountant.com)

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

@ImkeF that's a great article. Thank you for sharing! I agree with your comment about the mysterious M engine...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.