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

Summarize VS Summarizecolumn function in DAX

Hi,

 

Actually i am confused with Summerize and Summerizecolumn functions.

Can somebody explain it in easier words with example.

 

I have read sqlBi blog which is preety good, i am not able to understand why microsoft has released it since we have summerize function already.

I only understood in summerizeColumns have better performance and SUmmerizecolumns will apply filter context later after cross join and we can't use same column twice in summerizecolumns.

 

Please somebody tell me majot advantages of using summerizecolumns over summerize function.

 

Thanks,

Pravin

1 ACCEPTED SOLUTION

Hi,

 

Typically, it is recommended to use SummarizeColumns to add columns rather than Summarize.

 

Best Regards,

Giotto Zhi

View solution in original post

6 REPLIES 6
v-gizhi-msft
Community Support
Community Support

Hi,

 

The difference is that Summarize function has several pitfalls and performance issues, and for compatibility issues it cannot be fully fixed by Microsoft.

For example, here is test table:

100.PNG

if you want to summarize [Product] and [Sales]*[Unit Price] as [Profit] column, maybe you will use this:

Summarize Table = SUMMARIZE('Table','Table'[Product],"Profit",SUMX('Table','Table'[Sales]*'Table'[Unit Price]))

But this is not correct though it shows well.

You should use this instead of the above:

Summarize Table-2 = ADDCOLUMNS(SUMMARIZE('Table','Table'[Product]),"Profit",CALCULATE(SUMX('Table','Table'[Sales]*'Table'[Unit Price])))

If you use Power BI, Analysis Services 2016, or Excel 2016(*), you can use a new DAX function called SummarizeColumns which apparently is just a replacement of Summarize:

SummarizeColumns Table = SUMMARIZECOLUMNS('Table'[Product],"Profit",SUMX('Table','Table'[Sales]*'Table'[Unit Price]))

When you compare the query plans of the two versions using DAX Studio, you will notice that the SummarizeColumns is extremely efficient, requiring just one storage engine query and a smaller number of steps in the physical query plan.

Reference:

https://www.sqlbi.com/articles/introducing-summarizecolumns/ 

Hope this helps.

 

Best Regards,

Giotto Zhi

 

Anonymous
Not applicable

Before posting quetion here i already checked SQLBI blog.

 

So as i can see you got the same result with just syntax change in SUmmerizecolumn and Summerize with addcolumns.

 

I am still curious is there any major  differance other than performance?

 

Thanks,

Pravin

Hi,

 

Typically, it is recommended to use SummarizeColumns to add columns rather than Summarize.

 

Best Regards,

Giotto Zhi

Anonymous
Not applicable

Hi @v-gizhi-msft 

 

I know it is recommended i am asking reason behind it. is it only for performance or something else?

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

Hi,

 

SummarizeColumns can use Ignore function but summarize ca not.

20.PNG

Reference:

https://dax.guide/ignore/ 

 

Best Regards,

Giotto Zhi

Anonymous
Not applicable

Thanks @v-gizhi-msft 

 

Yes i have checked Ignore function with Summarize it is throwing error. You can use it with SUmmarizeColumns only.

 

So the conclusion is we can omit blank from measure output without doing any furtherstep in SUmmarizecolumn.

and other is it has better performance than Summarize.

 

Thanks,

Pravin

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.