Forum Discussion
DAX - Selected value
Hi
I wrote a measure where if is January is selected measure shows 1, february 2, so on till december.
Measure = switch(selectedvalue
(dim_table[month_name]),
"January",1,
"February",2)
Is it possible , if both January and February are selected, measure should show 1,2. If January,February and March are selected measure should show 1,2,3.
Thankyou
11 Replies
- tamerj1Community Champion
Hi Prabha45
if the month name column is coming from a date table the you can try.
CONCATENATEX ( VALUES ( 'Date'[Date].[Month] ), [Month], "," )
However, the following shall work in all scenarios
CONCATENATEX (
VALUES ( 'Table'[Month] ),
SWITCH (
[Month],
"January", 1,
"February", 2,
etc.
),
","
)
- FreemanZSuper User
hi Prabha45
1) try to add a column like:
month_number = SWITCH( [month_name], "January", 1, "February", 2, "March", 3, "April", 4, "May", 5, "June", 6, "July", 7, "August", 8, "September", 9, "October", 10, "November", 11, 12 )2) then plot a measure like this:
Measure = CONCATENATEX( TableName, TableName[month_number], "," )it worked like: