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
AMPAllie
Helper II
Helper II

Measure that Sums and Finds Value in Another Table with A Range

I have two tables

Table 1 lists sales

AMPAllie_0-1602081281420.png

Table 2 is a commission struture

AMPAllie_1-1602081344359.png

I have a measure that sums Table1[Amount] placed in a gauge with Year, month, Sales Rep slicers.

What I need to accomplish is a measure in another guage that determines the commission amount.

So i need to create something that sums Table1.[Total], then takes that value and looks to see into which range in Table2 that value falls, and returns the corresponding Table2.[Commission].

 

I have attempted to break up the ranges in Power Query with ={[Range Start]..[Range End]} and list all values to more easily find a corresponding value, but I end up with a table that has over 25M rows which is inefficient.

 

Any help is much appreciated.

4 REPLIES 4
amitchandak
Super User
Super User

@AMPAllie ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Table 1

WBS1InvoiceNumberPeriodTransDateInvoiceDateTotalAmtPR.NamePR.ProjectCustomTabFields.Sales RepPR.Project TypeAmount
19028.00.000000000821422020011/25/2020 12:00:00 AM2019-12-04T12:05:31.5270000-18219PG&E EGI Reconductor ProjectsPerson 1Engineering18219
19028.00.000000000822652020022/12/2020 12:00:00 AM2/12/2020 12:00:00 AM-46339.39PG&E EGI Reconductor ProjectsPerson 2Engineering46339.39
19028.00.000000000823652020077/11/2020 12:00:00 AM4/2/2020 12:00:00 AM-89113.33PG&E EGI Reconductor ProjectsPerson 3Engineering89113.33

 

Table 2

 

Range StartRange EndCommission
5000000999999910000
100000001499999915000
150000001999999920000
200000002499999925000
250000003000000030000

 

Output would just be a number

It's being a buggar with uploading

Let's try this

 

Table 1

 

AMPAllie_1-1602085360003.png

 

Table 2

 

AMPAllie_0-1602085256444.png

 

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.

Top Solution Authors