Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Slicer to switch between 2 columns

Hi, I want to create a slicer to switch between 2 columms, which are displayed in the visuals. One column contains the invoice amount including taxes (21%), the other column contains the same invo...
  • parry2k's avatar
    7 years ago

    Anonymous create another table with these two options and this table be not have relationship with anything, put column from this table as a slicer and use following dax to switch between values.

     

    Change table name/column name in following dax as per your data model. Now you can use following "Amount" measure in your visuals and value will change based on option selected on the slicer.

     

    Hope it is helpful

     

    Amount = 
    VAR __selectedSlicer = SELECTEDVALUE( NewTable[Slicer] )
    RETURN
    IF( __selectedSlicer = "Incl. Tax", SUM( Table[InclAmount] ), SUM( Table[ExclAmount] ) )