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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
lasoe
New Member

Get an error when using ^

Need to look at the lastlogon attribute from Active Directory.

I try to use this formular.

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

Found it here.

https://community.powerbi.com/t5/Developer/active-directory-LastLogon/td-p/22155

But every time i use ^ in a formular i get an error.

"Token EoF expected."

 

I tried with a simple one

= 10^11

That gives the same error.

Works fine in Excel.

 

1 ACCEPTED SOLUTION
KGrice
Memorable Member
Memorable Member

Hi @lasoe. The formula you're using is for DAX, so it's meant to be a measure or calculated column. Judging by the syntax, it's really a calculated column. If you're getting "Token EoF expected," you're still in the query editor and using the M language.

 

If you want to use it as is, you'll need to load your data first (close and apply in the query editor), and then go to the Data view (middle icon on the left side). Select your table, and then go to the Modeling tab in the ribbon and find the New Column button. You should be able to use your formula there, though it's missing a parenthesis as is.

 

If you want to use the formula in the query editor, here's the M equivalent. Note that M is case-sensitive.

 

= if [lastlogon] > 0 
then [lastlogon]/(8.64 * Number.Power(10, 11)) - 109205
else Date.FromText("2000-01-01")

 

View solution in original post

2 REPLIES 2
KGrice
Memorable Member
Memorable Member

Hi @lasoe. The formula you're using is for DAX, so it's meant to be a measure or calculated column. Judging by the syntax, it's really a calculated column. If you're getting "Token EoF expected," you're still in the query editor and using the M language.

 

If you want to use it as is, you'll need to load your data first (close and apply in the query editor), and then go to the Data view (middle icon on the left side). Select your table, and then go to the Modeling tab in the ribbon and find the New Column button. You should be able to use your formula there, though it's missing a parenthesis as is.

 

If you want to use the formula in the query editor, here's the M equivalent. Note that M is case-sensitive.

 

= if [lastlogon] > 0 
then [lastlogon]/(8.64 * Number.Power(10, 11)) - 109205
else Date.FromText("2000-01-01")

 

Thx.

That works.

Also explained a lot of other things to me. 🙂

 

Regards

Lars

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors
Top Kudoed Authors