Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

SELECTEDVALUE and multiple selections

Hi,   beneath is a measure I wrote that works fine if I make one selection from the slicer 'Channel'   Chosen Channel = VAR _metric_select = SELECTEDVALUE('Channel'[Channel ID]) VAR _nbrA = [Nu...
  • OwenAuger's avatar
    2 years ago

    Hi Anonymous 

    Based on what you've described, I would suggest something like this using SUMX / VALUES:

     

    New Measure =
    SUMX (
        VALUES ( 'Channel'[Channel ID] ),
        SWITCH (
            'Channel'[Channel ID],
            1, [Number of Transactions A],
            2, [Number of Transactions B],
            3, [Number of Transactions C]
        )
    )

     

    This would work for single or multiple selection. Also, I have not declared variables outside SWITCH storing the 3 possible values, which avoid unnecessary evaluation.

     

    Does this work as intended?

    Regards