Forum Discussion
raveenraveen
3 years agoFrequent Visitor
How to pass multiple value to switch
Hi, I am having multiple measures for each year data. I have a column that has multiple year values, say 2000, 2001, 2002 I want get data from measures based for each year in the years colum...
raveenraveen
3 years agoFrequent Visitor
Greg_Deckler How to pass multiple value to switch
We are having a table with year column and data for each year as calculated columns based year column.
We are having measures created seperately according to some conditions for each yearz say for year 2008 measure2008 is available.
My requirement is to plot a line graph for each year with the coreesponding year's measure value.
Greg_Deckler
3 years agoCommunity Champion
raveenraveen Then this should work:
SWITCH(MAX('Table'[Year]),
2000, [2000 Measure],
2001, [2001 Measure],
2002, [2002 Measure]
)
In the context of the visual, assuming Year column is on the X-Axis, the MAX('Table'[Year]) will return the value of the year in context. This is then mapped to the correct measure calculation.