Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
sakuragihana
Helper IV
Helper IV

Help me to fix my dax for calculating bonus of manager

Hello everyone, I have 2 table below :

Table Data :

sakuragihana_0-1687170874332.png

Table Bonus Scheme:

sakuragihana_1-1687170897776.png

I have a dax for calculating bonus for manager :

Bonus_Manager =
VAR area  = SELECTEDVALUE('Data'[Area Code])
VAR percentage = SELECTEDVALUE('Data'[Percentage])
VAR _bonustable =
    FILTER (
        'Bonus Scheme',
        'Bonus Scheme'[AreaCode ] = area
            && percentage >= 'Bonus Scheme'[Min]
            && percentage <= 'Bonus Scheme'[Max]
    )
VAR bonus_manager =SUMMARIZE( _bonustable, 'Bonus Scheme'[Bonus Manager])
Return bonus_manager
 
But the dax is working not exactly
 
sakuragihana_2-1687171355475.pngsakuragihana_3-1687171379132.png

 

The dax can not calculate the SouthArea.

I make a power BI file with table data in this link: https://drive.google.com/file/d/1BI-7-w2X6OP7-_aQ-tE1KPCKSIpOOuzl/view?usp=drive_link 

Can everyone help me to fix this dax ?

 

 

5 REPLIES 5
tamerj1
Super User
Super User

Hi @sakuragihana 
The 68% of the south area do not exist in any of the ranges of the Bonus Scheme. Which means south area deserves no bonus. 
In the sample file, the data table contains only one month of data but in reality, I suppose it will contain several months. 

1. I guess the one-many relationship in the sample file was created automatically by power bi which was not your intention. I suppose this relationship do not exist in the real data model? Please confirm the shape of the data model.

2. Will bonus value be calculated for each month and then aggregated at area level?

3. The bonus scheme already represents an extended period of time (it applies from 2019 to 2023). Would there be different schemes for different periods that we need to deal with?

Hi @tamerj1 ,

This is my answer :

1. This relationship in that model are existed in real data model. I have AreaCode for many campus and each campus belongs to different area

2.Yes, it will.

3.Yes, there be different schemes for this periods

Thank you

@sakuragihana 
In this case the one - many relation cannot be applied (it has to be many to many). Therefore, I can feel that you have over simplified the problem. The DAX code has to take into account all these inputs in order to work smoothly with the real data. Hence, please update the sample data reflecting all possible scenarios that need to be taken into account.

Hi @tamerj1 ,

I want to calculate the bonus of SouthArea is 0 . How can I do that ? Can you help me ?

@sakuragihana 

Sure but would you please reply to my other questions?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.