cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CJH Regular Visitor
Regular Visitor

Active Directory user.lastLogon

Hello,

 

I am trying to convert the active directory user.lastlogon and user.lastlogontimestamp to readable date and times.    The command below which I found on the Internet does not appear to be working for me.

 

Help!

 

Last Logon = IF(AD_user[user.lastlogon]>0, (AD_user[user.lastlogon]/8.64*10^11)-109205, DATE(2000,01,01))

1 ACCEPTED SOLUTION

Accepted Solutions
handrade Frequent Visitor
Frequent Visitor

Re: Active Directory user.lastLogon

Try the following code:

 

Last Logon = IF( AD_user[user.lastLogonTimestamp] > 0, AD_user[user.lastLogonTimestamp] / 864000000000 - 109205, DATE(2000,1,1) )

 

Make sure you assign the correct data type and that the default summarization is set to don't summarize. You can select the desired format.

AD_timespan.PNG

 

 

View solution in original post

2 REPLIES 2
handrade Frequent Visitor
Frequent Visitor

Re: Active Directory user.lastLogon

Try the following code:

 

Last Logon = IF( AD_user[user.lastLogonTimestamp] > 0, AD_user[user.lastLogonTimestamp] / 864000000000 - 109205, DATE(2000,1,1) )

 

Make sure you assign the correct data type and that the default summarization is set to don't summarize. You can select the desired format.

AD_timespan.PNG

 

 

View solution in original post

Highlighted
CJH Regular Visitor
Regular Visitor

Re: Active Directory user.lastLogon

Thank you!!  That did the trick.  

 

A tip for users, I set the last argument to 9999/01/01 to flag that there is no real last logon data available.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 57 members 1,051 guests
Please welcome our newest community members: