Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Tricky Switch and AND Function - combination

Hi Experts   I am trying to get the following out come based on the slicer selection criteria.... 1. If the user selects Gross Margin (first slicer) and then Reported (second slicer) then return t...
  • LaurentCouartou's avatar
    7 years ago

    SWITCH, just like IF, cannot return a table expression.

     

    Have you tried something like this?

    SWITCH(TRUE(),
        ProfitbabilityMeasure = "Gross Margin" && ReportingMeasure = "Reported"
           , CALCULATE( [GMvPY1% (Reported PY)]
                , TOPN(10, ALL('Product'[Category]),[GMvPY1% (Reported PY)])
    )
    , ...
    )