Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Trying to dynamically switch fields in a table

How do you switch fields in a table visual if you want different fields to appear?
I created a slicer and tried to create a DAX switch that would change the fields in the table visual. 
but using selectedvalue() i was unable to switch out the fields, depending on the choice because switch changes measurers

How do i create something similar to a switch() where depending on the user choice, i switch from one field to the other?
Ex. 

SWITCH
(
TRUE(),
[SelectedField] = "",Table[FieldName1],
[Selectedield] = "",Table[FieldName2],
[Selectedield] = "",Table[FieldName3],
[Selectedield] = "",Table[FieldName4]
)

3 Replies