0
votes

I have a chart as below,

enter image description here

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,

  1. Created a table,

|Monthly|1| |Quarterly|2| |Yearly|3|

  1. Created the selcted value measure as

    select = selectedvalue('table1'[column2])

  2. 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?

1
Even without the data type issue, a calculated column cannot be responsive to a slicer.Alexis Olson

1 Answers

0
votes

You can add buttons and use bookmarks to assign action based on Month, Quarter and Year to those buttons, all you need to do is create 3 visuals and align them then based on buttons make the visual visible/invisible and the update the bookmark.

enter image description here

enter image description here

enter image description here