Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
This has been bugging me for a while.
Why can I do this:
var wd = SELECTCOLUMNS(Filter(Dates,Dates[StartOfMonth]=Sick[Month] && Dates[IsWeekDay]=TRUE()),"Date",Dates[Date])
var ab= SUMMARIZE(Filter(Absence,Absence[LongTerm]=Sick[LongTerm]),Absence[Personnel Number],Absence[Start Date],Absence[Actual End Date])
var ab1=ADDCOLUMNS(ab,"d",COUNTROWS(INTERSECT(CALENDAR(Absence[Start Date],Absence[Actual End Date]),wd)))
but not this:
var wd = SELECTCOLUMNS(Filter(Dates,Dates[StartOfMonth]=Sick[Month] && Dates[IsWeekDay]=TRUE()),"Date",Dates[Date])
var ab= SUMMARIZE(Filter(Absence,Absence[LongTerm]=Sick[LongTerm]),Absence[Personnel Number],Absence[Start Date],Absence[Actual End Date],"Cal",CALENDAR(Absence[Start Date],Absence[Actual End Date]))
var ab1=ADDCOLUMNS(ab,"d",COUNTROWS(INTERSECT([Cal],wd)))
or more generic
var tablevariable1 = SUMMARIZE(table,column1,column2,"new column",tablevariable2)
var tablevariable3 = ADDCOLUMNS(tablevariable1,"Count",COUNTROWS([tablevariable2]))
i need to walk up and down a multidimensional hierarchy and do aggregrations between the hierarchies. That requires temporarily storing tables in fields of the parent table, and then retrieving the child tables again for processing.
So far the only option I can see is to do a fully explicit table processing without the possibility of storing the table variable for later retrieval. Is that a DAX design limitation or am I using the wrong syntax? This is very easy to do in Power Query, so I hope that I'm just overlooking something obvious.
you can use the table variables within the table expression, but the syntax has to be valid, which in your case is not possible with SUMMARIZE
the issue is here:
VAR ab =
SUMMARIZE (
FILTER ( Absence, Absence[LongTerm] = Sick[LongTerm] ),
Absence[Personnel Number],
Absence[Start Date],
Absence[Actual End Date],
"Cal", CALENDAR ( Absence[Start Date], Absence[Actual End Date] )
)
SUMMARIZE requires last argument to be scalar expression, CALENDAR returns table, which makes the syntax invalid and causes error.
the reason it works for
VAR ab =
SUMMARIZE (
FILTER ( Absence, Absence[LongTerm] = Sick[LongTerm] ),
Absence[Personnel Number],
Absence[Start Date],
Absence[Actual End Date]
)
VAR ab1 =
ADDCOLUMNS (
ab,
"d",
COUNTROWS (
INTERSECT ( CALENDAR ( Absence[Start Date], Absence[Actual End Date] ), wd )
)
)
is that the result of CALENDAR is only evaluated in memory when caclulating the scalar value - no need for "materialized" nested tables
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
8 | |
6 | |
5 |
User | Count |
---|---|
17 | |
14 | |
10 | |
9 | |
8 |