Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Bonus calculation using Power BI (measure)

Every time the Employee "SalesRepresetativeID" reaches 5 new customers "OrderNumber", Employee gets; 100$ bonus.

So, it is actually a bonus calculation using Power BI (measure). 

I tried this approach, but it is only giving True and False value if the count of "OrderNumber" is greater or equal to 5.

Bonus_Sample = CALCULATE(COUNT(Table[OrderNumber])>=5,ALLEXCEPT(Table,Table[SalesRepresentativeID]))

 

Can anyone help me for creating the DAX formula? 

Many thanks for considering my request.

  • Anonymous's avatar
    Anonymous
    5 years ago

    Anonymous 

    If you want a measure, you do not need allexept to group by:

     

    Bonus = IF(COUNT('Table'[OrderNumber])>=5,500,0)
     

     


    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.

     

3 Replies

  • Anonymous , This measure with Sales Representative should help

     

    Sumx(filter(summarize(Table, Table[SalesRepresentativeID], "_1", COUNT(Table[OrderNumber])),[_1] >=5),[_1])

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak, This measure is only counting the OrderNumber if it is more or equal to 5. But I would like to add the bonus of 500$ if the orders are equal or more than 5.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

    If you want a measure, you do not need allexept to group by:

     

    Bonus = IF(COUNT('Table'[OrderNumber])>=5,500,0)
     

     


    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.