title: Making Switch function return a column in a table and not a measure (PowerBI DAX)
body: <p>What I'm trying to do is to change measures using slicers in Power BI Desktop. I have found some examples of people who have done that (for instance <a href="https://www.youtube.com/watch?v=gYbGNeYD4OY&amp;list=PLREfg6vaHQL81lHyhzqbixk8i5fQidwmW&amp;index=3" rel="nofollow noreferrer">this</a> ) . </p>
  
  <p>What they do is that they create a table where there are ID and Measure names. The 'Measure names' column of this table will be used as field value in the filter of the visualization. Then, they create a switch function that, given a certain value in the filter, switch the value in the filter to a measure. 
  You can see an example below:</p>
  
  <pre><code>Measure Value = SWITCH(
                              MIN('Dynamic'[Measure ID]) ,
                              1,[Max Temp],
                              2,[Min Temp],
                              3,[Air Pressure],
                              4,[Rainfall],
                              5,[Wind Speed],
                              6,[Humidity]
                              )
  </code></pre>
  
  <p>Where 'Dynamic' is a group containing a measure ID and a Measure name:</p>
  
  <p>Dynamic:</p>
  
  <pre><code>Measure ID | Measure Name
  1          |  Max Temp
  2          |  Min Temp
  3          |  Air Pressure
  4          |  Rainfall
  5          |  Wind Speed
  6          |  Humidity
  </code></pre>
  
  <p>All of the 'Measure Name' are measures as well.</p>
  
  <p>My problem is: I have too many columns (400!) and I cannot turn them into measures one by one. It will take days. I was thinking that maybe I could use the switch function so that it returns the column in the table and NOT the corresponding measure. However I cannot just insert 
  <code>'Name of the table'['Name of the column']</code> in the switch function as result parameter.</p>
  
  <p>Does anyone know how to make the function Switch return a column and not a measure? (Or any other suggestion)</p>