Forum Discussion

TomaszTub's avatar
TomaszTub
Regular Visitor
5 years ago
Solved

bonus - proper range search

Hi,

 

Can someone help find proper solution?  

I have two tabeles . First with turnovers and second with scale I woluld like to find realted range to calculate proper percentage value.  

turnover value startturnover value end%
080000
8001120002
12001140003

 

Nameturnoverbonus %bonus
Emp 1790000
Emp 2110002220
Emp 3130003390
  • Hi,

    In Table2, write these calculated column formulas

    Bonus % = CALCULATE(MIN(Table1[%]),FILTER(Table1,Table1[turnover value start]<=EARLIER(Table2[turnover])&&Table1[turnover value end]>=EARLIER(Table2[turnover])))
    Bonus = Table2[Bonus %]*Table2[turnover]

    Hope this helps.

4 Replies

  • Hi,

    In Table2, write these calculated column formulas

    Bonus % = CALCULATE(MIN(Table1[%]),FILTER(Table1,Table1[turnover value start]<=EARLIER(Table2[turnover])&&Table1[turnover value end]>=EARLIER(Table2[turnover])))
    Bonus = Table2[Bonus %]*Table2[turnover]

    Hope this helps.

  • AlB's avatar
    AlB
    Icon for Community Champion rankCommunity Champion

    Hi TomaszTub 

    You need to explain better. Please provide the expected result for the sample data, explaining the rationale behind it.

     

    Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.