Forum Discussion
Anonymous
2 years agoNot applicable
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...
- 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
OwenAuger
2 years agoSuper User
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