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! Learn more

Reply
Schorse
Regular Visitor

Read correct price from table with minimum quantities

Hello all,

I have a (hopefully simple) problem that you guys can probably help me with....

 

I want to read out the corresponding price from a table with prices via Measure.


My problem is that in the SalesPrice table there are only the minimum quantities from which a certain price is valid.
If there would be also a maximum value, I would manage that. At least I think so.

 

The SalesPrice table is structured as follows:

 

ItemNo.  |  MinQuantity  |  Price
4711       | 1.000               |  3.99
4711       |  10.000            |  2,99
5888       |  2.000              |  1.59
5888       |  3.000              |  1.45
...             |  ...                    |  ....


Does anyone have a solution for me there? Or do you need more info?

Thanks a lot!

 

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @Schorse ,

 

Have your problem solved?

If yes, please make that post helpful to you, as a solution. So that others have the same problems as you can find the answer quickly.

 

If no, maybe you can try this measure.

 

Measure =
VAR _minq =
    CALCULATE(
        MIN( 'Table'[MinQuantity] ),
        ALLEXCEPT(
            'Table',
            'Table'[ItemNo.]
        )
    )
RETURN
    CALCULATE(
        MIN( 'Table'[Price] ),
        FILTER(
            ALLEXCEPT(
                'Table',
                'Table'[ItemNo.]
            ),
            [MinQuantity] = _minq
        )
    )

 

Result:

vchenwuzmsft_0-1642413539108.png

If i misunderstood you ,please share you pbix file without sensitive data and expect result.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-chenwuz-msft
Community Support
Community Support

Hi @Schorse ,

 

Have your problem solved?

If yes, please make that post helpful to you, as a solution. So that others have the same problems as you can find the answer quickly.

 

If no, maybe you can try this measure.

 

Measure =
VAR _minq =
    CALCULATE(
        MIN( 'Table'[MinQuantity] ),
        ALLEXCEPT(
            'Table',
            'Table'[ItemNo.]
        )
    )
RETURN
    CALCULATE(
        MIN( 'Table'[Price] ),
        FILTER(
            ALLEXCEPT(
                'Table',
                'Table'[ItemNo.]
            ),
            [MinQuantity] = _minq
        )
    )

 

Result:

vchenwuzmsft_0-1642413539108.png

If i misunderstood you ,please share you pbix file without sensitive data and expect result.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Schorse , it is not clear what price you want to read

 

a new column with min price

minx(filter(Table, [ItemNo] =earlier([ItemNo]) ) , [Price] )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello @amitchandak,

 

I have another table with sales quantities to the items.

And now I want to find out the corresponding price by measure.

So I don't need the minimum price per item, but the price per item for a certain retrieved quantity.

sorry, that I should have certainly still write there.

@Schorse , we can create columns across tables but need sample data for that

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello @amitchandak 

 

thank you very much for your support.

 

I just want to insert the correct price in the Sales table.

 

I am not able to upload a file. Therefore, I would just need a formula that will fill me the Price column in the Sales table....

 

ItemQuantityPrice
47111500?
471120000?
58882000?
58883500?

 

 

Sales-Price-Table:

 

ItemNoMinQuantityPrice
471110003,99
4711100002,99
588820001,59
588830001,45


Thanks a lot
Schorse

@Schorse  You can copy paste some sample here from excel or power bi

or load a file on drop box or onedrive and share link

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

Top Solution Authors