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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Performance Issue after using GroupBy

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!

 

 

 

3 REPLIES 3
ImkeF
Super User
Super User

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

v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

To optimize the performance, please refer to this case.

https://stackoverflow.com/questions/7943957/huge-performance-difference-when-using-group-by-vs-distinct

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
AnkitBI
Solution Sage
Solution Sage

This is unexpected. Can you share complete queries for all from Advanced Editor

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors