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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
okiselova
Frequent Visitor

calculate Measure of MIN/MAX based on another measure taking into account data range

Could you please help me with formula. Unfortunately I couldn't find solution.

I need to find MIN stock between all dates in the range of data - Country&Product group&Sku name. The problem is that I want to calculate it on another Measure basis (Calculated stock). I managed to find min stock, but it it finds min stock in all data, not separatly by every country, product group and SKU.
Please see the example below. Min stock.JPG

 Thank you!!!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@okiselova , Assume your measure is calculated Stock

the over all min

 

calculate(minx(summarize(Table, Table[Country], Table[Product code], Table[SKU], Table[Year]),[calculated Stock]), allselected(Table))

 

Country level min

 

calculate(minx(summarize(Table, Table[Country], Table[Product code], Table[SKU], Table[Year]),[calculated Stock]), filter(allselected(Table), Table[Country] = max(Table[Country])) )

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

View solution in original post

Dear @amitchandak ,

 

Thank you very much! It works perfectly!🙂

Now I understand what was my mistake.

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@okiselova , Assume your measure is calculated Stock

the over all min

 

calculate(minx(summarize(Table, Table[Country], Table[Product code], Table[SKU], Table[Year]),[calculated Stock]), allselected(Table))

 

Country level min

 

calculate(minx(summarize(Table, Table[Country], Table[Product code], Table[SKU], Table[Year]),[calculated Stock]), filter(allselected(Table), Table[Country] = max(Table[Country])) )

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

Dear @amitchandak ,

 

Thank you very much! It works perfectly!🙂

Now I understand what was my mistake.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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