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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (25)