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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.