Forum Discussion

govind_021's avatar
govind_021
Super User
1 year ago
Solved

Dax

Hi Dax experts , I have one scenerio pleae help me , if you see i have parameter and has three categories year , quarter and category  it is not always the case that thse selection will be in the ...
  • v-saisrao-msft's avatar
    v-saisrao-msft
    1 year ago

    Hi govind_021, 
    Thank you for reaching out to the Microsoft fabric community forum. Thank you @ for your input on this issue. 
    After thoroughly reviewing the details you provided

    Dax Measure: 

    Check = 
    SWITCH(
        TRUE(),
        ISINSCOPE('Date'[QuarterInCalendar]),
            CALCULATE([Total Sales], REMOVEFILTERS('Date'[QuarterInCalendar])),
        ISINSCOPE('Date'[Year]),
            CALCULATE([Total Sales], REMOVEFILTERS('Date'[Year])),
        ISINSCOPE('Product'[Category]),
            CALCULATE([Total Sales], REMOVEFILTERS('Product'[Category])),
        [Total Sales]
    )

    Output: 

     


    If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly. 
     
    Thank you.