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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
OliverO
Helper II
Helper II

DAX - SUMMARIZE V SUMMARIZECOLUMNS in DAX filter

Hi

 

I have got some DAX where I join 2 tables in a union where some manual adjustments get added to data from a different source which makes up the majority of the data.

I need to filter out the main data so that if data (based on two fields) exists in the adjustments, I want to exclude those combinations appearing in the main data.

 

I have got the DAX working as I want it, but I was interested in finding out if I can replace the SUMMARIZE (below in RED) with SUMMARIZECOLUMNS.

It doesn't seem to work when I use SUMMARIZECOLUMNS, but I don't know why.

 

Many thanks

Oliver

 

 

zz Claims Return 2 =

SUMMARIZECOLUMNS (

    'Claims Solvency 2 Return'[Claim Reference],

    'Claims Solvency 2 Return'[UMR],

    'Claims Solvency 2 Return'[Risk Code],

    FILTER (

        'Claims Solvency 2 Return',

        NOT (

             ( 'Claims Solvency 2 Return'[UMR]  , 'Claims Solvency 2 Return'[Claim Reference] )

                IN SUMMARIZE  (

                    'S2 Manual (Claims)',

                    'S2 Manual (Claims)'[UMR] ,  'S2 Manual (Claims)'[Claim Reference]

                )

        )

    )

)

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi @OliverO ,

According to your description, I created this data and copied your operation, and got the following error:

Claims Solvency 2 Return:

v-yangliu-msft_0-1616745942496.png

S2 Manual (Claims):

v-yangliu-msft_1-1616745942497.png

Use SUMMARIZE to get results:

v-yangliu-msft_2-1616745942497.png

This error occurs when using SUMMARIZECOLUMNS:

v-yangliu-msft_3-1616745942501.png

 

This is because you cannot apply an external filter context (such as CALCULATE or CALCULATETABLE) to SUMMARIZECOLUMNS, so you cannot use it in metric expressions, making it useless in most measures.

 

This is the content of the related link, I hope it helps you

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

https://social.msdn.microsoft.com/Forums/silverlight/en-US/363ce011-0aa7-4f35-9979-77691b76b1bf/summ...

https://community.powerbi.com/t5/Desktop/SummarizeColumns-and-AddMissingItems-may-not-be-used-in-thi...

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi @OliverO ,

According to your description, I created this data and copied your operation, and got the following error:

Claims Solvency 2 Return:

v-yangliu-msft_0-1616745942496.png

S2 Manual (Claims):

v-yangliu-msft_1-1616745942497.png

Use SUMMARIZE to get results:

v-yangliu-msft_2-1616745942497.png

This error occurs when using SUMMARIZECOLUMNS:

v-yangliu-msft_3-1616745942501.png

 

This is because you cannot apply an external filter context (such as CALCULATE or CALCULATETABLE) to SUMMARIZECOLUMNS, so you cannot use it in metric expressions, making it useless in most measures.

 

This is the content of the related link, I hope it helps you

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

https://social.msdn.microsoft.com/Forums/silverlight/en-US/363ce011-0aa7-4f35-9979-77691b76b1bf/summ...

https://community.powerbi.com/t5/Desktop/SummarizeColumns-and-AddMissingItems-may-not-be-used-in-thi...

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Liu Yang!

MFelix
Super User
Super User

Hi @OliverO ,

 

Check this article by SQLBI with the difference between both functions.

 

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

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thanks Miguel!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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