Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to Reference a Minimum Quantity field when looking at actual Quantities on a Vendor Ledger Entries Table
For Example:
If Customer is 39007 and item is 1000063 and Unit is BDL and quantity is 14 return price $193.93. Since it didnt mean the requuirements of min qty 15 use min qty 10 and the associated price.
Sales Price Table
Cust | Item | UOM | Start date | Min Qty | Unit_Price |
38007 | 1000063 | BDL | 4/16/2021 | 5 | 203.15 |
38007 | 1000063 | BDL | 4/16/2021 | 10 | 193.93 |
38007 | 1000063 | BDL | 4/16/2021 | 15 | 190.4 |
VLE Table
Cust | Item | UOM | Qty |
38007 | 1000063 | BDL | 14 |
Solved! Go to Solution.
Hi @Anonymous ,
Please new a calculated colum:
Minimum Value =
VAR _cust = 'VLE Table'[Cust]
VAR _item = 'VLE Table'[Item]
VAR _uom = 'VLE Table'[UOM]
VAR _min_qty =
CALCULATE (
MIN ( 'Sales Price Table'[Min Qty] ),
FILTER (
ALL ( 'Sales Price Table' ),
'Sales Price Table'[Cust] = _cust
&& 'Sales Price Table'[Item] = _item
&& 'Sales Price Table'[UOM] = _uom
)
)
VAR _price =
CALCULATE (
MAX ( 'Sales Price Table'[Unit_Price] ),
FILTER (
ALL ( 'Sales Price Table' ),
'Sales Price Table'[Cust] = _cust
&& 'Sales Price Table'[Item] = _item
&& 'Sales Price Table'[UOM] = _uom
&& 'Sales Price Table'[Min Qty] = _min_qty
)
)
RETURN
_price
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi @Anonymous ,
Please new a calculated colum:
Minimum Value =
VAR _cust = 'VLE Table'[Cust]
VAR _item = 'VLE Table'[Item]
VAR _uom = 'VLE Table'[UOM]
VAR _min_qty =
CALCULATE (
MIN ( 'Sales Price Table'[Min Qty] ),
FILTER (
ALL ( 'Sales Price Table' ),
'Sales Price Table'[Cust] = _cust
&& 'Sales Price Table'[Item] = _item
&& 'Sales Price Table'[UOM] = _uom
)
)
VAR _price =
CALCULATE (
MAX ( 'Sales Price Table'[Unit_Price] ),
FILTER (
ALL ( 'Sales Price Table' ),
'Sales Price Table'[Cust] = _cust
&& 'Sales Price Table'[Item] = _item
&& 'Sales Price Table'[UOM] = _uom
&& 'Sales Price Table'[Min Qty] = _min_qty
)
)
RETURN
_price
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
10 | |
6 |