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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Rose__123
Helper II
Helper II

How to search for similar cells in one column, but use the numbers from another column

I have a table containing invoice numbers, customer IDs, total cost, salespersons, etc. and I would like to calculate the commission that should be provided to the salesperson. The commission percentage is set to 5 %, however, for some specific customers, the percentage is different. The table looks something like this:

Invoice number    CustomerID   Cost   Salesperson   Commission  
1Berit1005.00Lars?
210002324304.00Susan?
3Hello10.00Susan?
41343220000.89Lars?

Therefore, I also have a lookup table that contains specific customer names or numbers and the associated commission.  It looks like this:

CustomerID   Commission percentage
Berit6
100026539

I would then like to write the code to calculate the commission that should be provided to the salespersons for the different invoices. 

 

I can find if the invoice contains a customer that provided a different commission, but I can't apply the commission.  How should I do?

 

IF( Invoices[CustomerID] IN DISTINCT(Commission_exceptions[CustumerID]),
 ???,
Invoices[Cost]/100*5 )
1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @Rose__123 ,

 

if you want the comission as a calculated column in the Invoice table try the following calculated column:

Comission =
VAR vRowCustomer = Invoice[CustomerID]
RETURN
    CALCULATE(
        MAX( Comission[Commission percentage] ),
        Comission[CustomerID] = vRowCustomer
    )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

View solution in original post

2 REPLIES 2
selimovd
Super User
Super User

Hey @Rose__123 ,

 

if you want the comission as a calculated column in the Invoice table try the following calculated column:

Comission =
VAR vRowCustomer = Invoice[CustomerID]
RETURN
    CALCULATE(
        MAX( Comission[Commission percentage] ),
        Comission[CustomerID] = vRowCustomer
    )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

Thank you it works! 🙏 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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