Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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
User | Count |
---|---|
131 | |
108 | |
101 | |
67 | |
64 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |