The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello, I have created parameter and based on that I would like to calculate dynamic table using SUMMARIZECOLUMNS function. Is that possible at all? Below you can find my DAX idea using SWITCH and IF however it does not work. I need a table as a result of SWITCH / IF statement.
EVALUATE
SWITCH (
TRUE (),
@Selected_Values = 0, SUMMARIZECOLUMNS ( 'Test Table'[Column] ),
SUMMARIZECOLUMNS (
'Test Table'[Column],
KEEPFILTERS (
FILTER (
ALL ( 'Sources'[Source] ),
PATHCONTAINS ( @Source, 'Sources'[Source] )
)
),
"Calculation", COUNTROWS ( 'Test Table' )
)
)
And with IF:
EVALUATE
IF (
@Selected_Values = 0,
SUMMARIZECOLUMNS ( 'Test Table'[Column] ),
SUMMARIZECOLUMNS (
'Test Table'[Column],
KEEPFILTERS (
FILTER (
ALL ( 'Sources'[Source] ),
PATHCONTAINS ( @Source, 'Sources'[Source] )
)
),
"Calculation", COUNTROWS ( 'Test Table' )
)
)
Thanks
EVALUATE
IF (
@Selected_Values = 0,
SUMMARIZECOLUMNS ( 'Test Table'[Column] ),
SUMMARIZECOLUMNS (
'Test Table'[Column],
KEEPFILTERS (
FILTER (
ALL ( 'Sources'[Source] ),
PATHCONTAINS ( @Source, 'Sources'[Source] )
)
),
"Calculation", COUNTROWS ( 'Test Table' )
)
)
Proud to be a Super User!
Unfortunately this is the same I have pasted. To be clear on this, I need a table as a result of SWITCH / IF statement. Thanks