Forum Discussion

karthikmiriyala's avatar
karthikmiriyala
Frequent Visitor
3 years ago

Add dynamic Categories from what if parameter

Hi,

I am trying to create a column that categorizes Groups from input What if parameters. Groups are not changing with the input values. 

 

These are the Default values that are given.

 Groups are forming with these default values, if I am changing slicers values Groups should also change, which is not happening.

 

 

Thank you in advance.

tamerj1 

amitchandak 

Jihwan_Kim 

daXtreme 

Greg_Deckler 

9 Replies

  • Hello karthikmiriyala !

     

    I believe you need to use SELECTEDVALUE() on _selected_x and _selected_y. 

     

    Something like:  _selected_x = SELECTEDVALUE(' Sepal Lenght'[...])

    • karthikmiriyala's avatar
      karthikmiriyala
      Frequent Visitor
      VAR X = VALUE(iris[sepal.length])
      VAR Y = VALUE(iris[sepal.width])
      VAR _selected_X = SELECTEDVALUE('Sepal Length'[Sepal Length])
      VAR _selected_Y = SELECTEDVALUE('Sepal Width'[Sepal Width])
      RETURN
      SWITCH(
      TRUE(),
      X <= _selected_X && Y <= _selected_Y , "Group 1",
      X <= _selected_Y && Y > _selected_Y , "Group 2",
      X > _selected_Y && Y <= _selected_Y , "Group 3",
      X > _selected_Y && Y > _selected_Y , "Group 4",
      BLANK()
      )
       
       
       
      If I am giving Selectedvalue() then all groups show Group 4.
       
      • JorgePinho's avatar
        JorgePinho
        Solution Sage

        I'm not sure if I'm thinking correct but why are you comparing the X with the selected Y on the 3 last conditions?