Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
I used group by to add an index column that restart counting at 1 when the unique id changes, i referred to this https://community.powerbi.com/t5/Desktop/power-query-condtitional-index-column-by-category-and/td-p/... and managed to do it with the following queries but when i try to sort one of the rows, it took more than 30 mins and it load up to 7Gb and still loading and i could not wait for it to finish loading. My source is a 7.65Mb text file with 8 million rows. i have 7 columns and two other table inside the query editor.
Please help me to solve this performance issue.
#"Grouped Rows" = Table.Group(#"Reordered Columns", {"Unique"}, {{"Index1", each Table.AddIndexColumn(_,"Index1", 1,1), type table}}),
#"Expanded Index1" = Table.ExpandTableColumn(#"Grouped Rows", "Index1", {"Column1.1", "Custom", "Steptime", "Index", "Custom.1", "Index1"}, {"Index1.Column1.1", "Index1.Custom", "Index1.Steptime", "Index1.Index", "Index1.Custom.1", "Index1.Index1"})
Any help is greatly appreciated!
Thank You!
Hi @Anonymous ,
you will most likely solve this by using a buffer function somewhere before the group-step.
It's a bit of a trial and error to find the right place for it:
https://www.thebiccountant.com/speedperformance-aspects/
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
Hi @Anonymous ,
To optimize the performance, please refer to this case.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.