I have a chart as below,
Here I have certain metrics which needs to be shown as Monthly, quarterly, yearly.
Ex. if monthly is selcted chart should show in months as mentioned,
if quarterly is selected chart should show in quarter and same applies for yearly.
So I tried with following code,
- Created a table,
|Monthly|1| |Quarterly|2| |Yearly|3|
Created the selcted value measure as
select = selectedvalue('table1'[column2])
Created a switch to use that calculated column in axis of the bar chart,
switch[select] 1,'calendar[Month]', 2,'calendar[Quarter]', 3,'calendar[year]')
Output is showing as variant data-type cannot be used in calcualted column,
I understand that some values are either text or number, how to change accordingly to same datatype. I have tried with zero also it is showing the same error.
Is there any other approach to this dynamic changing of columns?