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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Reference a Minimum Value

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

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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

vcgaomsft_0-1664947506797.png

 

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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

vcgaomsft_0-1664947506797.png

 

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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