Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
hi,
I have the following table: "COSTORCOUNT"
and a parameter table: "parameterTable"
I'm tring to return a table according to selectedvalue from the "parameterTable"
I put the paramter column in a slicer.
when selecting 0 -the excepted resuelt is the following table:
and when selecting 1 -
Below is the code:
dynamicSlicer =
VAR _TableAdi = SUMMARIZECOLUMNS(COSTORCOUNT[Flag])
VAR _TableTamir = SUMMARIZECOLUMNS(COSTORCOUNT[Flag],FILTER(COSTORCOUNT,COSTORCOUNT[Flag]=0))
VAR _Switch = IF( SELECTEDVALUE(parameterTable[parameter]) = 1,
_TableAdi, _TableTamir)
return _Switch
I'm getting the following error:
The expression specified in the query is not a valid table expression.
any advice will be appreciated.
Thank you, Adi
Solved! Go to Solution.
@adicarmeliEX_ I've never had any luck with DAX being able to return one table or another table. It doesn't like it. Try this instead:
dynamicSlicer =
VAR _Selected = SELECTEDVALUE(parameterTable[parameter])
VAR _Table = SUMMARIZE(FILTER(COSTORCOUNT, [Flag] = _Selected),[Flag])
RETURN
_Table
@adicarmeliEX_ I've never had any luck with DAX being able to return one table or another table. It doesn't like it. Try this instead:
dynamicSlicer =
VAR _Selected = SELECTEDVALUE(parameterTable[parameter])
VAR _Table = SUMMARIZE(FILTER(COSTORCOUNT, [Flag] = _Selected),[Flag])
RETURN
_Table
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.