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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Aggro
Frequent Visitor

Calculate Salesperson's Commission Tier

I have a table_a contains salesperson's commission data and is grouped by month. I want to find out it's commission tier in table_b, and below is the tables' info. I want to show the salesperson's sales tier and commission rate in table_a. The period from table_a, should be equal or greater than the effective date in table_b because we may change the commission rate.

The salesperson's needs to meet order counts and total sales to earn the tier.

 

table_a

 

Sales personalPeriodOrder CountsTotal SalesExpected TierExpected Commission Rate
John9/30/2023101500112.00%
John10/31/20232511249912.00%
Amy8/31/20233001500023.00%
Amy9/30/20234002500023.00%
Amy8/31/20235002900034.00%
Alex10/31/20235993200034.00%
Bradon10/31/20236503300045.00%

 

 

 

table_b

Effective DateSales TierOrder CountsTotal SalesCommission Rate
7/1/20231100           5,0002.00%
7/1/20232250        12,5003.00%
7/1/20233450        22,5004.00%
7/1/20234600        30,0005.00%
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Aggro you can add the calculated column using following DAX expression and use the same logic to get the Commission Rate:

 

Tier 1 = 
VAR __Period = TableA[Period]
VAR __Orders = TableA[Order Counts]
VAR __Sales = TableA[Total Sales]
RETURN
CALCULATE ( 
    MAX ( TableB[Sales Tier] ),
    TableB[Effective Date] <= __Period,
    TableB[Order Counts] <= __Orders,
    TableB[Total Sales] <= __Sales
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

@Aggro you can add the calculated column using following DAX expression and use the same logic to get the Commission Rate:

 

Tier 1 = 
VAR __Period = TableA[Period]
VAR __Orders = TableA[Order Counts]
VAR __Sales = TableA[Total Sales]
RETURN
CALCULATE ( 
    MAX ( TableB[Sales Tier] ),
    TableB[Effective Date] <= __Period,
    TableB[Order Counts] <= __Orders,
    TableB[Total Sales] <= __Sales
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

JorgePBI
Advocate I
Advocate I

This might get you started and get the juices flowing

Sales Tier and Commission Rate = 
VAR CurrentMonth = MAX('Table_A'[Period])  
RETURN
CALCULATE(
    SELECTEDVALUE('Table_B'[Commission Tier], "No Tier Defined"),
    FILTER(
        'Table_B',
        'Table_B'[Effective Date] <= CurrentMonth
        && 'Table_A'[Total Sales] >= 'Table_B'[Minimum Sales]
        && 'Table_A'[Order Count] >= 'Table_B'[Minimum Order Count]
    )
)

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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