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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
taimaizumi
Helper I
Helper I

Behavior of summarizecolumns

Hi, community!
I have a question abou t behavior of summarizecolumns.
The detail is as follows.

-------------------------------------------------------

<Premise>
Calendar table has only one column named "YeaMonth" with some values as shown below

taimaizumi_0-1700686413195.png


<My question>
Why below query output different result

1 : 
EVALUATE
    VAR tbl = SUMMARIZECOLUMNS( Calendar[YearMonth] )
     VAR tbl2 = CALCULATETABLE(tbl,Calendar[YearMonth] = 202310)
RETURN tbl2

taimaizumi_1-1700686608475.png


2
EVALUATE
   VAR tbl =
   CALCULATETABLE(
        SUMMARIZECOLUMNS( Calendar[YearMonth] ),
        Calendar[YearMonth] = 202310
    )
RETURN
tbl

 

taimaizumi_2-1700686657200.png


-------------------------------------------------------

I can understanad latter one in which summarizecolumn is evaluated in context with "YearMonth" column filtered by 202310.
but I'm not sure about former one.

I would appreciate if someone could help me.

Best regards

1 ACCEPTED SOLUTION
OguzMavice
Resolver II
Resolver II

Hi @taimaizumi , 

 

summarizecolumn works as groupby function in sql/python/etc.., means it makes unique groupby column and calculate aggregation based on this primary key if you want. 

 

calculatetable in dax, assist to create new pbi calculated table based on already one. For example, you can create calculate table by filtering some column. If you want create a calculated table with uniqpue key and aggregation by this unique key; you should use summarizecolumn. 

 

In the second dax you wrote, you make groupby in summarizesection and also filter out your calendar date by specific value(202310), then create new table. Actually, you can use directly summarizecolumn without calculatetable. 

 

In the first dax you wrote; you did not filter out your tbl table. You made group by in summarization section like second dax, but when you wrote calculatetable function you did not filter out your new tbl table; you filter out independent table ( calendar table). So actually result shows tbl table not tbl 2 , means your calculateble function in the first dax is not properly constructed.

View solution in original post

2 REPLIES 2
OguzMavice
Resolver II
Resolver II

Hi @taimaizumi , 

 

summarizecolumn works as groupby function in sql/python/etc.., means it makes unique groupby column and calculate aggregation based on this primary key if you want. 

 

calculatetable in dax, assist to create new pbi calculated table based on already one. For example, you can create calculate table by filtering some column. If you want create a calculated table with uniqpue key and aggregation by this unique key; you should use summarizecolumn. 

 

In the second dax you wrote, you make groupby in summarizesection and also filter out your calendar date by specific value(202310), then create new table. Actually, you can use directly summarizecolumn without calculatetable. 

 

In the first dax you wrote; you did not filter out your tbl table. You made group by in summarization section like second dax, but when you wrote calculatetable function you did not filter out your new tbl table; you filter out independent table ( calendar table). So actually result shows tbl table not tbl 2 , means your calculateble function in the first dax is not properly constructed.

Hi, @OguzMavice 
Thank you for your kind reply!

I got your point. Maybe my uderstanding about calculatetable was wrong.

Once table is construced and put away into variable, that variable is not expression anymore.

That's why it'll be evaluated again even if it's envoked within calculatetable with some filter applied.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors