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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Poor performance of GROUPBY vs SUMMARIZE

Hi DAX experts,

 

From all I've read, GROUPBY() should be at least as performant as SUMMARIZE() but I've found it substantially slower. Below are two equivalent queries - the GROUPBY() version takes about 6x longer. Any advice on why there is such a big difference?

 

Thanks!

 

GROUPBY():
CALCULATETABLE (
    GROUPBY (
        Fact_PlexosSolutionData,
        Dim_Date[FinancialYear],
        Dim_Model[ModelId],
        "TotalGenCost"SUMX ( CURRENTGROUP (), Fact_PlexosSolutionData[Generators.GenerationCost.$] )
    ),
    FILTER ( Dim_Facility, Dim_Facility[IsPPA] )
)

 

SUMMARIZE():
CALCULATETABLE (
    SUMMARIZE (
        Fact_PlexosSolutionData,
        Dim_Date[FinancialYear],
        Dim_Model[ModelId],
        "TotalGenCost"SUM ( Fact_PlexosSolutionData[Generators.GenerationCost.$] )
    ),
    FILTER ( Dim_Facility, Dim_Facility[IsPPA] )
)

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , while groupby can slow down the performance because it needs sumx(X functions) . It has its own advantages. So those case you should use group by. But you can avoid it where something else can be used. 

https://www.sqlbi.com/blog/marco/2016/02/15/groupby-vs-summarize-in-dax-powerbi-powerpivot/

https://www.sqlbi.com/articles/nested-grouping-using-groupby-vs-summarize/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
fcarvalho
Advocate I
Advocate I

Hi,

There is any alternative to AverageX and Summarize?

In terms of performance I can't load a table properly. Always getting that the visual exceeded the resources..

 

For example:

 

Measure = AVERAGEX( SUMMARIZE( VALUES( Client[ClientID] ) , "average", [Discount] ), [average] )

amitchandak
Super User
Super User

@Anonymous , while groupby can slow down the performance because it needs sumx(X functions) . It has its own advantages. So those case you should use group by. But you can avoid it where something else can be used. 

https://www.sqlbi.com/blog/marco/2016/02/15/groupby-vs-summarize-in-dax-powerbi-powerpivot/

https://www.sqlbi.com/articles/nested-grouping-using-groupby-vs-summarize/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks @amitchandak and @Greg_Deckler for your insights. It does seem to be the SUMX that slows it down. Removing the aggregation gives roughly equal performance. 

Greg_Deckler
Community Champion
Community Champion

@Anonymous - This does not surprise me, GROUPBY must use an interator function like SUMX, etc. so that's likely the source of the performance difference. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.