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.
Hi,
I'm working on a project looking at the commission we receive from suppliers based on the amount of business we send. I need to automate the process of looking up what level of commission has been achieved against each supplier. Usually, I would use a VLOOKUP TRUE formula in Excel, but I'm struggling to get this to work in Power BI.
Data:
Table 1
Table 2
On table 1, I need to get the level achieved & the commission % available based on the commissionable amount.
I've tried the following solution for level achieved, but it's returning a blank.
Any help appreciated!
Thanks,
Kitty
Solved! Go to Solution.
Hi @Kitty-SD
This is probably what you want.
A calculated column
Level Achieved =
VAR Commissionable = StoredProcedure[Supplier Due]
VAR Boundary =
TOPN (
1,
FILTER (OverrideAgreements,OverrideAgreements[Target] <= Commissionable && OverrideAgreements[SupplierId] = StoredProcedure[SupplierId]),
OverrideAgreements[Target], DESC
)
RETURN
MAXX (Boundary,OverrideAgreements[Level])
A measure
Level Achieved Measure =
VAR Commissionable = SELECTEDVALUE(StoredProcedure[Supplier Due])
VAR SupplierId = SELECTEDVALUE(StoredProcedure[SupplierId])
VAR Boundary =
TOPN (
1,
FILTER (OverrideAgreements,OverrideAgreements[Target] <= Commissionable && OverrideAgreements[SupplierId] = SupplierId),
OverrideAgreements[Target], DESC
)
RETURN
MAXX (Boundary,OverrideAgreements[Level])
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!
Hi @Kitty-SD
This is probably what you want.
A calculated column
Level Achieved =
VAR Commissionable = StoredProcedure[Supplier Due]
VAR Boundary =
TOPN (
1,
FILTER (OverrideAgreements,OverrideAgreements[Target] <= Commissionable && OverrideAgreements[SupplierId] = StoredProcedure[SupplierId]),
OverrideAgreements[Target], DESC
)
RETURN
MAXX (Boundary,OverrideAgreements[Level])
A measure
Level Achieved Measure =
VAR Commissionable = SELECTEDVALUE(StoredProcedure[Supplier Due])
VAR SupplierId = SELECTEDVALUE(StoredProcedure[SupplierId])
VAR Boundary =
TOPN (
1,
FILTER (OverrideAgreements,OverrideAgreements[Target] <= Commissionable && OverrideAgreements[SupplierId] = SupplierId),
OverrideAgreements[Target], DESC
)
RETURN
MAXX (Boundary,OverrideAgreements[Level])
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!
@Kitty-SD , a new columnin table one
var _max = maxx(table2, Table1[supplier] = table1[Supplier] && Table1[Supplier due]>= Table2[Target]),Table2[Target])
return
maxx(table2, Table1[supplier] = table1[Supplier] && Table1[Supplier due]= _max ),Table2[Comission %])
I'm getting this error!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
96 | |
75 | |
63 | |
62 |
User | Count |
---|---|
135 | |
105 | |
104 | |
80 | |
65 |