Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Conditional segmentaion based on specific value

Hi all,

In a previous thread we came to this function to use conditions in order to calculate a bonus value. 

Basicly

if value < 8500, 0 

if value < 9000, 100, 150

 

BonusTestM = 
VAR BonusMin = SELECTEDVALUE('BonusValue'[BonusMin])
VAR BonusMax = SELECTEDVALUE('BonusValue'[BonusMax])
VAR BonusValueMin = SELECTEDVALUE('BonusValue'[BonusValueMin])
VAR BonusValueMax = SELECTEDVALUE('BonusValue'[BonusValueMax])
RETURN
SWITCH(
TRUE()
,SUM(Income[Value]) < BonusMin, 0
,SUM(Income[Value]) < BonusMax, BonusValueMin
,BonusValueMax
)

 

I put these values in a table to make it eassier to change for management, like this:

But now the requirement is to be able to select a person and see what their bonusses are. Here an example of the data:

So would it be possible to change the function so that you can click on a name in the left field, and it starts the function above with their bonus conditions/values? Hope my question is clear.

 

So for example I click "Eric" and it shows his income and at the same time the start the "BonusTestM" function with his bonus conditions/values from the last picture? So his minimum bonus would be 8500 to 9000 for 100 and 9000 and more for 150. I'm not sure if this is possible or what would be a good alternative. For example a check box where you select the persons name and that name is then used in the function to look up their bonus info?

 

Thanks a lot!

 

 

 

  • Hi Anonymous ,

     

    You can create a Slicer to have Person Names in then and then select the name.

    What happens when you select a person's name, doen't it filter the value on your right table for that person only?

     

    Thanks,

    Pragati

7 Replies

  • Hi Anonymous ,

     

    You can create a Slicer to have Person Names in then and then select the name.

    What happens when you select a person's name, doen't it filter the value on your right table for that person only?

     

    Thanks,

    Pragati

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Pragati11 

       

      Thansk for mentioning the slicer. I tried to click the names in the small table, but that didn't work.

      The slicer seems to be working with the conditions of the individual people. Only thing is, it still shows everyone's data, but just lets the function work on a single person, if that makes sense.

      Here's a picture:

      When I remove the measure, it only shows the selected person:

       

      Also the total value is still weird, but I'll figure that out later with the HASONFITLER you mentioned.

       

      • Pragati11's avatar
        Pragati11
        Super User

        HI Anonymous ,

         

        Is it possible to share the pbix file for this after removing any sensitive information?

         

        Thanks,

        Pragati

  • v-yingjl's avatar
    v-yingjl
    Community Support

    Hi Anonymous ,

    So has it been solved by @ Pragati11 ? If so, you can accept the reply as solution, that way, other community members could easily find the answer when they get same issues.

     

    Best Regards,
    Community Support Team _ Yingjie Li