Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Slicer option multiple conditions

Hi.   I have a custom slicer with several options to choose from. I want to create a measure that when I click one (or more) options from the slicer, a map shows the values (count of something for ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

    You can create a measure as below and check whether it can get your expected result:

    Measure =
    VAR _sellist =
        ALLSELECTED ( 'SlicerTable'[colname] )
    RETURN
        IF ( "OPTION 1" IN _sellist, COUNT ( 'Table'[A] ), 0 )
            + IF ( "OPTION 2" IN _sellist, COUNT ( 'Table'[B] ), 0 )
            + IF ( "OPTION 3" IN _sellist, COUNT ( 'Table'[C] ), 0 )

    In addition, you can refer the content in the following blogs. Hope they can give you some clue or insights...

    Dynamic Measure Selection in Power BI

    Power BI DAX Dynamic Measures

    Change Measures Using a Slicer in Power BI

    If the above ones can't help you find the solution, please share some sample data with Text format and your expected result with backend logic and special examples in order to provide you a suitable solution. Thank  you.

    Best Regards