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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
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.