title: Dynamic column change in visual based on slicer in power BI
body: <p>I have a chart as below,</p>
  <p><a href="https://i.stack.imgur.com/vfmPP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vfmPP.png" alt="enter image description here" /></a></p>
  <p>Here I have certain metrics which needs to be shown as Monthly, quarterly, yearly.</p>
  <p>Ex. if monthly is selcted chart should show in months as mentioned,</p>
  <p>if quarterly is selected chart should show in quarter and same applies for yearly.</p>
  <p>So I tried with following code,</p>
  <ol>
  <li>Created a table,</li>
  </ol>
  <p>|Monthly|1|
  |Quarterly|2|
  |Yearly|3|</p>
  <ol start="2">
  <li><p>Created the selcted value measure as</p>
  <p>select = selectedvalue('table1'[column2])</p>
  </li>
  <li><p>Created a switch to use that calculated column in axis of the bar chart,</p>
  <p>switch[select]
  1,'calendar[Month]',
  2,'calendar[Quarter]',
  3,'calendar[year]')</p>
  </li>
  </ol>
  <p>Output is showing as variant data-type cannot be used in calcualted column,</p>
  <p>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.</p>
  <p>Is there any other approach to this dynamic changing of columns?</p>