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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PBIDEVELOP
Regular Visitor

Minimum value of date filtered measure

Hi,

 

I have a measure, which calculates stock balance for max date. Date is used as a row filter in matrix table, so my measure calculates all stock transactions till the date in a row (see picture below). I need to write a measure which will find me lowest stock value in selected date range (in my example it will be 8616) Any suggestions how to do that?

 

pic.png

 

  

 
 
 
4 REPLIES 4
amitchandak
Super User
Super User

@PBIDEVELOP , try like

minx(summarize(table, table[date],"_1",[stock balance]),[_1])

Thanks. This is exactly what i was looking for. 

And if i would like to write a measure to get date having minimum value?

The blog article I referenced had the solution:

MinScoreMeasure = MINX ( SUMMARIZE ( Groups, Groups[Group] , "AVG",[AverageScoreMeasure] ), [AVG])

 If you want to lookup the value having that, use this pattern:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434

 

Or, if you need it as a single line:

MAXX(FILTER(__Table,[__Value] = __Max),[Item])

Where __Max is your min or max


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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