Forum Discussion

whichOne's avatar
whichOne
Frequent Visitor
2 years ago
Solved

matrix show columns based on slicer selection

I have a table with multiple columns structure similar to this:   measure 1 measure 2 measure 3 measure 4 company a         company b           I am trying to ad a slicer a...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi whichOne 

    Based on your needs, I have created the following table.




     

     


    Then you can create a measure by using the following dax:

    Dynamic = SWITCH(TRUE(),
    SELECTEDVALUE('Parameter (2)'[Parameter]) = 1,CALCULATE(SELECTEDVALUE('Table'[VALUE]),FILTER('Table','Table'[Column1] = 1 || 'Table'[Column1] = 2)),
    SELECTEDVALUE('Parameter (2)'[Parameter]) = 2,CALCULATE(SELECTEDVALUE('Table'[VALUE]),FILTER('Table','Table'[Column1] = 3 || 'Table'[Column1] = 4)),
    SELECTEDVALUE('Table'[VALUE]) )

     



    Put the corresponding fields into the table so that you can make the table display specific columns based on the slicer selection.

     

     

     

    Result:

     






     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.