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.
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 personal | Period | Order Counts | Total Sales | Expected Tier | Expected Commission Rate |
John | 9/30/2023 | 101 | 5001 | 1 | 2.00% |
John | 10/31/2023 | 251 | 12499 | 1 | 2.00% |
Amy | 8/31/2023 | 300 | 15000 | 2 | 3.00% |
Amy | 9/30/2023 | 400 | 25000 | 2 | 3.00% |
Amy | 8/31/2023 | 500 | 29000 | 3 | 4.00% |
Alex | 10/31/2023 | 599 | 32000 | 3 | 4.00% |
Bradon | 10/31/2023 | 650 | 33000 | 4 | 5.00% |
table_b
Effective Date | Sales Tier | Order Counts | Total Sales | Commission Rate |
7/1/2023 | 1 | 100 | 5,000 | 2.00% |
7/1/2023 | 2 | 250 | 12,500 | 3.00% |
7/1/2023 | 3 | 450 | 22,500 | 4.00% |
7/1/2023 | 4 | 600 | 30,000 | 5.00% |
Solved! Go to Solution.
@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.
@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.
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]
)
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
94 | |
74 | |
71 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |