How to construct filter tables for SUMMARIZECOLUMNS
function?
The SUMMARIZECOLUMNS has the following pattern:
SUMMARIZECOLUMNS(
ColumnName1, ...
ColumnNameN,
FilterTable1, -- my question concerns this line
FilterTableN,
Name1, [measure1],
NameN, [measure2],
)
I have checked that the following 3 patterns work. They return the same results, at least for the simple sample data I used.
SUMMARIZECOLUMNS (
T[col],
FILTER( T, T[col] = "red" )
)
SUMMARIZECOLUMNS (
T[col],
CALCULATETABLE( T, T[col] = "red" )
)
SUMMARIZECOLUMNS (
T[col],
CALCULATETABLE ( T, KEEPFILTERS ( T[col] = "red" ) )
)
Is any of these patterns superior over the other?
Reference: https://www.sqlbi.com/articles/introducing-summarizecolumns/
Update
I would be interested in an answer that contains a query plan analysis or link to credible source. I would be grateful if you mentioned using the SUMMARIZECOLUMNS function when grouping columns from multiple tables.
dax
orpowerbi
are not popular. There is narrow community of just a few people. Starting regular bounty does not even increase the views because those few people will see those few posts that are posted here every week. That is why I would like to start a bounty that may encourage people to tackle the problem. The question itself is not a bug correction request. There is a possibility ot reward existing answer and I would like to inform community that I am going to do it if answer appears. Why not? – Przemyslaw Remin