The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
80 | |
80 | |
48 | |
40 |
User | Count |
---|---|
150 | |
110 | |
64 | |
64 | |
58 |