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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
hyggins
Helper I
Helper I

Create a measure to lookup a value in an unrelated table using values from another measure?

I’ve been scouring the forums and unable to find anything that matches my needs.

 

I have two tables, one is an accounting transaction table [tblAccountingGL], the other is a commission lookup table [tblComLookup]. There is no relationship in the data model.

 

We sum the sales transaction values by employee by month. This is done with a measure called [TotalSales]. This monthly total is what determines their commission %.

For example, if they sell between $0 and $9,999 the commission is 3%. Sales between $10,000 and $24,999 it’s 4%, etc.

 

I need to create a measure that returns the Commission % based on the value of the measure [TotalSales].

Example: If [TotalSales] for February = 16,000 then return a value of 4%. The [TotalSales] value of $16,000 is between $10,000 and $24,999 as represented in the commission table so 4% is returned.

 

Commission Table Sample

Record Id 

Min Sales Value 

 Max Sales Value 

 Commission %

1

0

9999

3%

2

10000

24999

4%

3

25000

50000

5%

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can use SWITCH in table  [tblAccountingGL] itself with the assumption table [tblComLookup] is not dynamic
=SWITCH (
  TRUE (),
 [TotalSales]>0 && [TotalSales]<=999,0.03,
[TotalSales]>=10000 && [TotalSales]<=24999,0.04,
and so on.....
)

If table [tblComLookup] is dynamic
You can create a range of values using SWITCH
SWITCH (
TRUE(),
[TotalSales]>0 && [TotalSales]<=999,"0-999",
[TotalSales]>=10000 && [TotalSales]<=24999,"10000-24999",
and so on.....

and for [tblComLookup], join both Min and Max sales values [Min Sales value] & "-" & [Max Sales Value].
then create relationship between the newly created columns and you can get your commission %. 

Hope it works. Pls let me know if any suggestions/corrections.


View solution in original post

1 REPLY 1
Anonymous
Not applicable

You can use SWITCH in table  [tblAccountingGL] itself with the assumption table [tblComLookup] is not dynamic
=SWITCH (
  TRUE (),
 [TotalSales]>0 && [TotalSales]<=999,0.03,
[TotalSales]>=10000 && [TotalSales]<=24999,0.04,
and so on.....
)

If table [tblComLookup] is dynamic
You can create a range of values using SWITCH
SWITCH (
TRUE(),
[TotalSales]>0 && [TotalSales]<=999,"0-999",
[TotalSales]>=10000 && [TotalSales]<=24999,"10000-24999",
and so on.....

and for [tblComLookup], join both Min and Max sales values [Min Sales value] & "-" & [Max Sales Value].
then create relationship between the newly created columns and you can get your commission %. 

Hope it works. Pls let me know if any suggestions/corrections.


Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors