Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Change decomposition tree root with slicer or button

Hi everyone,    I have a decomposition tree visual where I analyze the unit cost by brand name and class name and I would like to give the users the ability to choose between unit cost and unit pri...
  • rsbin's avatar
    4 years ago

    Anonymous,

    Through this forum, I found a new technique that I have started to use.  Create a Measure with a SWITCH statement depending on your Slicer selection.

    1) Create a table with your two options:  Unit Cost and Unit Price

    2) Creat a Slicer with this table

    3) Create a Measure to read your Slicer selection:  SelectedOption = SelectedValue( Options[Value] )

    4) Create a new Measure something like:

           

    VisualMeaure = 
       Switch(
          [SelectedOption] = "Unit Price", [Unit Price],
          [SelectedOption] = "Unit Cost", [Unit Cost] )

     Not sure if this syntax is correct, but hope you get the idea.

    I have not used the Decomposition Visual, but hope this idea works for you.

    Regards,