Showing results for 
Search instead for 
Did you mean: 
Advocate III
Advocate III

Finding the most recent value

Hi all,

I have survey data with multiple people taking the survey mutiple times.  Each row is a survey response with a date taken. The only way I know which is the "pre survey" and which is the post survey is by the date taken.  I would like to create a "prepost Colunm that read the date and designated pre or post. I have tried a combination of If and Max but I can't seem to get it to work.. Any tips?



Great solution.  Thanks!

Using excel, but this helped me get there. Kudos!

Regular Visitor

Thanks! This worked immediatly, at first it gave me errors in Excel. Your addition helped me out.


Thanks again to you all!

Regular Visitor

Sorry I am e newbie at this forum, I presumed "Reply" would reply to the post is was under.


My previous post was meant as a reaction at @JohnH


For his addition:


I got it to work with adding "yourtablename" as the first paramber in the FILTER:

CALCULATE(MAX(yourtablename[yourDatecolumn]),FILTER(yourtablename, yourtablename[Name]=EARLIER(yourtablename[Name])))



Frequent Visitor

We have similar case.

We need to select the most recent value based on the latest DateTime and DIA value. can someone give us the idea to resolve this?



Hi@alikhan_3 ,


Can you share what is the exact ouput you require based on the table provided.


Can you post the data to One Drive / Google Drive and share the link here to find a solutiom.






Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

I was getting a circular dependency error on my indicator column.  I just combined them into one calculation and it worked.


MaxRun =
'Table'[Plant] = EARLIER(''Table'[Plant]),
'Table'[AsOfDate] = EARLIER('Table'[AsOfDate])
) = 'Table'[RunTime], 1, 0)


Helpful resources

November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!


Power Platform October Community Highlights

Check out the top community contributors across all of the communities


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