cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Getting max date and then an accompanying column

Hello everyone

 

I have a table where I have captued the customer ID and the list of products they purchased and when (date/time).

From this I want to know which was the last product they purchased.

 

But I cannot seem to figure out the method to extract this result.

Here is what my data looks like and the expected result.

Kindly assist.

 

Untitled.png

11 REPLIES 11
Highlighted

@fahadarshad

 

Revised Measure.

 

LastProduct =
CALCULATE (
    FIRSTNONBLANK ( TableName[Product], 1 ),
    FILTER ( TableName, TableName[Date] = MAX ( TableName[Date] ) )
)
Regards,
Zubair


Highlighted

thanks bhai for the help! works superb. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors