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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
lbrown
Helper I
Helper I

Dax Measure for Commission Amount based on # Sales Between Two Numbers

I am attempting to create a dax measure that will calculate the total commission amount based on a filter of "eligible for payout" and the # Sales between two numbers. So if Validation 1 Column = "Eligible for Payout" and the # Sales Column is between 0-6 then I want to take the # Sales * the $ amount per sale.

 

Example: If Validation 1 Column = "Eligible for Payout" and the # Sales Column = 16 then I want to take 16 * $14 to get $224.

 

Another Example: If Validation 1 Column = "Eligible for Payout" and the # Sales Column = 5 then I want to take 5 * $7 to get $35. 

 

Want I want to see in a Power BI Table is this: 

Validation 1     # Sales    Commission Amount
Eligible for Payout 16$224
Eligible for Payout 15$210
Eligible for Payout 15$210
Eligible for Payout 9$81

 

What I currently have in a Power BI Table is this:

 Capture.JPG

 

The Commission Tier is this:

 

Capture2.JPG

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

So, probably something like:

 

Measure =
VAR __sales = MAX([# Sales])
VAR __commission =
  SWITCH(TRUE(),
    __sales<=6,LOOKUPVALUE('Commissions'[$/Sale],'Commissions'[#Sales],"0-6"),
    __sales<=9,LOOKUPVALUE('Commissions'[$/Sale],'Commissions'[#Sales],"7-9"),
    __sales<=14,LOOKUPVALUE('Commissions'[$/Sale],'Commissions'[#Sales],"10-14"),
    __sales<=19,LOOKUPVALUE('Commissions'[$/Sale],'Commissions'[#Sales],"15-19"),
    LOOKUPVALUE('Commissions'[$/Sale],'Commissions'[#Sales],"20+")
)
VAR __eligible = MAX([Validation 1])
RETURN
IF([Validation 1]<>"Eligible for Payout",0,__sales * __commission)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks Greg,

 

I am receiving an error message on the If statement for [Validation 1] column. I forgot to mention the commission values are in a separate table titled "FL Commission Rates" and the query table holding the data is in a table titled "FL Agents Commission". There's no unique identifier to create a relationship between these two tables. Any suggestions on how to fix the error message?

 

Also, should the [# Sales] column be the column from the "FL Agents Commission" table which is actually a measure to get the count of comissions per agent or should I use the [# Sales] column from the "FL Commission Rates" which is the chronological number from 0-20 in a column? I'm a little confused on this part.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.