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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
iamprajot
Responsive Resident
Responsive Resident

getting lowest value and highest value

Hi, I need to know how to get the lowest ShippingPrice and the highest ShippingPrice for a ProductID. Thanks

 

ProductIDShippingPriceLowest PriceHighest Price
532.38  
611.61  
465.83  
341.34  
451.30  
358.17  
522.98  
9148.33  
313.97  
481.91  
1140.51  
43.25  
455.09  
43.05  
848.29  
9146.06  
63.67  
255.28  
325.73  
4208.58  
866.29  
54.56  
1136.54  
64.54  

 

 

 

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

Hi @iamprajot,

 

In addition, you can also create measures or calculated columns use ALLEXCEPT Function below:

 

Lowest Price = CALCULATE(MIN('Table2'[ShippingPrice]),ALLEXCEPT(Table2,'Table2'[ProductID]))

Highest Price = CALCULATE(MAX('Table2'[ShippingPrice]),ALLEXCEPT(Table2,'Table2'[ProductID]))

 

q2.PNG

 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
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

4 REPLIES 4
v-qiuyu-msft
Community Support
Community Support

Hi @iamprajot,

 

In addition, you can also create measures or calculated columns use ALLEXCEPT Function below:

 

Lowest Price = CALCULATE(MIN('Table2'[ShippingPrice]),ALLEXCEPT(Table2,'Table2'[ProductID]))

Highest Price = CALCULATE(MAX('Table2'[ShippingPrice]),ALLEXCEPT(Table2,'Table2'[ProductID]))

 

q2.PNG

 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Much appreciated, thanks.

malagari
Responsive Resident
Responsive Resident

This is perfect use for the EARLIER function.

 

Lowest Price = CALCULATE( MIN([Shipping Price]), 
FILTER(Table, [ProductID] = EARLIER([ProductID]))
)

 

And similar, you can switch MIN to MAX for the Highest Price for that Product.

 

The FILTER component will return a table of similar ProductIDs to the row being calculated on, and then the MIN function will return the lowest shipping price for this filtered table. 

Dan Malagari
Consultant at Headspring

Unfortunatly it shows an error and highlights the Red part

EARLIER/EARLIEST refers to an earlier row context which doesn't exist.

 

Lowest Price = CALCULATE( MIN([Shipping Price]), 
FILTER(Table, [ProductID] = EARLIER([ProductID]))
)

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.