Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Return a Table With a SWITCH

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 pa...
  • Greg_Deckler's avatar
    3 years ago

    Anonymous 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