Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Solved! Go to Solution.
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")
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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
89 | |
49 | |
44 | |
38 | |
37 |