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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

DAX Formula to Calculate Last Activity?

Hi everyone-

 

I am looking to write a simple DAX formula that will only select the most recent date in the 'Expires' column. As you can see in the attached photo, the 'Expires' column logs the date and time whenever a user does any activity. How would I write a formula that just selects the most recent date? For the first user in the first five rows, I would just want the most recent date and time selected and to disregard anything before.

 

Also, disregard the fact that the user data is in JSON. I'm going to go through and clean that up so ultimately it will just have the userID in the column alongside the expires column. Thanks!powerbi-dax.PNG

 

3 REPLIES 3
StefanoGrimaldi
Resident Rockstar
Resident Rockstar

if you doing this on DAX, theres a formula called: LastDate( ) this will always select for the DAX according how you use it as the last date on the selected column, if you want the table to be remake filtering out the other record, create a new talbe with "calculatedtable" and use the lastdate function on the calculated segment fo the new table to filter it out by the last date.





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




Anonymous
Not applicable

So ultimately what I'm trying to do is the following...

 

I have this table of user information, sorted by date of creation:

powerbi-user2.PNG

I'm trying to insert a column that shows last activity (which might be logging in, a new enrolllment, etc) which is tracked in this table:

powerbi-user.PNG

They are connected with the UserId. What's the best way to go about this?

them just use the LastDate( ) function a the modeling tab new column option, enter that dax and give the date column as parameter. 





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.