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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
datadonuts
Advocate II
Advocate II

Commission calculation in a measure

I guess for most of you that's a fairly simple task, unfortunately not for me.

I am trying to calculate the commission on sales depending on a country table:

'Sales Territory'[Country] ) = "United States" gets 15% commission, all other countries get 10%.

 

With a calculated column that's straight forward, but I want a measure.

 

Calculated column commission =
IF (
RELATED ( 'Sales Territory'[Country] ) = "United States",
[Revenue] * 0.15,
[Revenue] * 0.1
)
 
Expected ResultExpected Result
 
I tried my way through CALCULATE and IF or SWITCH, but no way to get any close to a solution. The closest I could get is:
 
Sales Commissions =
[Revenue]
* IF (
HASONEVALUE ( 'Sales Territory'[Country] ),
IF ( VALUES ( 'Sales Territory'[Country] ) = "United States", 0.15, 0.1 )
)
 
But it doesn't show a total bc of the HASONEVALUE function.
 
Screenshot 2020-10-23 013406.jpg
 

 

 
Please help.
Thanks a lot!
 
 
Screenshot 2020-10-23 010344.jpg
 
 
 
 
1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

@datadonuts please try this code

SUMX(VALUES('Sales Territory'[Country]),IF (
 'Sales Territory'[Country]  = "United States",
[Revenue] * 0.15,
[Revenue] * 0.1
))

View solution in original post

1 REPLY 1
wdx223_Daniel
Super User
Super User

@datadonuts please try this code

SUMX(VALUES('Sales Territory'[Country]),IF (
 'Sales Territory'[Country]  = "United States",
[Revenue] * 0.15,
[Revenue] * 0.1
))

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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