Forum Discussion
How to pass multiple value to switch
raveenraveen I don't think I am understanding your use case. It comes down to context. So, for example, you put your Year column into a table visual as the rows or you put the Year column in a Matrix column as the colums or rows. Thus, in the visual context grabbing the MAX of the Year returns the year in the current context (row or column) and you return your desired measure. If this is not the use case, perhaps you can explain exactly what you are trying to accomplish in terms of the visual configuration.
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_Deckler3 years ago
Community 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.