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
KieronMullan
Frequent Visitor

calculating a date from an Active Directory value

Hoping someone can help....

 

I have a Excel spreadsheet connected to our active directory, which pushes out date values such 'Last login' as a power value (e.g. 1.32066E+17).  In excel I had a formula that converted the number into a value to show the correct date.  Excel Formula is [@[user.lastLogon]]/(8.64*10^11)-109205, which when formatted as a date column shows '03/07/2019'

 

I have connected PBI directly to the same AD source and trying to do the same calculation in PowerBI as a custom column, with the following formula:

Last Login Date = DIVIDE([user.lastLogon],(8.64*10^11)-109205)

However, the date is now showing as the year 2315

 

Any ideas how to correct this as i would have thought the source values being the same would work out of the box?

Thanks

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

your formula is not the same, you subtract from the denominator in PowerBI, this one is just like in Excel

Last Login Date = DIVIDE ( [user.lastLogon], 8.64 * 10 ^ 11 ) - 109205

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
KieronMullan
Frequent Visitor

Thank you - spot on!!!

Stachu
Community Champion
Community Champion

your formula is not the same, you subtract from the denominator in PowerBI, this one is just like in Excel

Last Login Date = DIVIDE ( [user.lastLogon], 8.64 * 10 ^ 11 ) - 109205

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.