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.