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
tracyhopaulson
Resolver I
Resolver I

Find the Minimum and Last Value based on multiple rows using DAX

Hi, I need help to find the minimum of one set of values and last of another set of values.  I tried min/max formula but cannot figure out how to do min/last.  For ex) in order AB0057 I would like to pull 3/29 as my new minimum date from the Old Value, and 4/19 as my new date from the New Value (not 4/26 because it was created on 3/20 which is not the latest.  Can someone please help me?

 

Capture.JPG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@tracyhopaulson - This following DAX Calculated Column is working for me. It first calculates the max CreateDate for the relevant Order. Then it finds the rows that have that Order and CreateDate and finds the max NewValue.

New Date = 
var maxcreate = Calculate(
	max('Table1'[CreateDate]),
	ALLEXCEPT('Table1','Table1'[Order])
)
return CALCULATE(
	max('Table1'[NewValue]),
	ALLEXCEPT('Table1','Table1'[Order]),
	'Table1'[CreateDate] = maxcreate
)

Result:

New Date.PNG

Hope this helps,

Nathan

View solution in original post

10 REPLIES 10

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.