Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Dynamic slicer

Hi,   I have a slicer based on one of the dimension table column , I Have a two different Dax function ( measure )  which are coming from same fact table. I would like to show the different measur...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Create a separate table with your SlicerSelection. This table should not be related to any other table.  Then create the measures you want to use

    Active = CALCULATE( [All], Table1[Ac_Cust_ID] <> blank())
    
    All = COUNTROWS( Table1 )
    
    Inactive = [All] - [Active]

    Then use this measure in your KPI:

    Selected Value = 
    SWITCH( 
        SELECTEDVALUE(SlicerSelection[Selection]),
        "Active", [Active],
        "All", [All],
        "Inactive", [Inactive],
        "Please Only Select One"
    )