Forum Discussion
How should I use the SWitch function for my two data sources?
- 4 years ago
fssebastian , Assuming they are tables. You need a common date/year table then you can create a measure like
if(year(max('Date'[Date]) = Year(Today) , sum(TableA[Value]) , sum(TableB[Value]) )
you need use year/date in visual from date/year table
if needed
sumx(Values('Date'[year]) , if(year(max('Date'[Date]) = Year(Today) , sum(TableA[Value]) , sum(TableB[Value]) ) )
fssebastian , Assuming they are tables. You need a common date/year table then you can create a measure like
if(year(max('Date'[Date]) = Year(Today) , sum(TableA[Value]) , sum(TableB[Value]) )
you need use year/date in visual from date/year table
if needed
sumx(Values('Date'[year]) , if(year(max('Date'[Date]) = Year(Today) , sum(TableA[Value]) , sum(TableB[Value]) ) )
Thank you, my mind just went blank for a minute. This helps. Thank you!