Forum Discussion

yossil's avatar
yossil
Frequent Visitor
7 years ago
Solved

bypass a slicer

Hi    i'm reposting the issue, this time with a simple example.   I have table with column "Cycle" represent the reporting cycle (Quick report or Final report) And other columns like "month" (as...
  • v-chuncz-msft's avatar
    7 years ago

    yossil,

     

    You may try the measure below.

    Measure =
    VAR c =
        SELECTEDVALUE ( 'Table2'[cycle] )
    VAR m =
        CALCULATE ( MAX ( Table1[month] ), ALLSELECTED ( Table1[month] ) )
    RETURN
        SUMX (
            FILTER (
                Table1,
                SWITCH (
                    c,
                    "Quick", ( Table1[cycle] = "Final"
                        && Table1[month] < m )
                        || ( Table1[cycle] = c
                        && Table1[month] = m ),
                    Table1[cycle] IN VALUES ( Table2[cycle] )
                )
            ),
            Table1[amount]
        )