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
YavuzDuran
Helper III
Helper III

Commission Calculation - A Shared Deal between 2 sales people

Hi All,

 

I have a sales team, and some sales are being shared between 2 salespeople, for commission. Each has a % share.

 

YavuzDuran_2-1636036618175.png

 

YavuzDuran_1-1636036605326.png

The formula for Commission is :

=SUMIF($B$2:$B$7,B12,$G$2:$G$7)+SUMIF($D$2:$D$7,B12,$H$2:$H$7)

 

On Power BI Sales Person 1 is my Sales Person name which I put on my table to calculate the total commission for each. 

A Sales Person name appears most of the time in the Salesperson 1 column but also on Sales Person 2 column for some deals.

 

I tried to find all lines a salesperson name appears (either on Salesperson name 1 or salesperson name 2) and used this formula 

 

Total Commission = sum(SalesCommission[Sales Person 1 Commission])+calculate(sum(SalesCommission[Sales Person 2 Commission),
filter(SalesCommission,CONTAINSSTRING(SalesCommission[Sales Person 2],SalesCommission[Sales Person 1])))
 
but it is not working, 
 
All I am trying to find those lines in which Sales Person 2 column contains Sales Person 1 name and return the Sales Person 2 Commission number. 
 
Please help, Thank you
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @YavuzDuran ;

You could create a measure as follows:

Measure = 
var _a=CALCULATE(SUM([Sales Person 1Sales Person 1 Commission]),ALLEXCEPT('Table','Table'[Person1]))
var _b= CALCULATE(SUM([Sales Person 2 Commission]),FILTER(ALL('Table'),[Person 2]=MAX([Person1])))
return _a+_b 

The final output is shown below:

vyalanwumsft_0-1636348550779.png

vyalanwumsft_1-1636348558742.png

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @YavuzDuran ;

You could create a measure as follows:

Measure = 
var _a=CALCULATE(SUM([Sales Person 1Sales Person 1 Commission]),ALLEXCEPT('Table','Table'[Person1]))
var _b= CALCULATE(SUM([Sales Person 2 Commission]),FILTER(ALL('Table'),[Person 2]=MAX([Person1])))
return _a+_b 

The final output is shown below:

vyalanwumsft_0-1636348550779.png

vyalanwumsft_1-1636348558742.png

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

It helped me Thank you 

Thank you,

Is there any way to show Luis only once in the table (same for Roman)

 

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.