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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
PowerBiPro2000
Frequent Visitor

13 digit EPOCH getting error when adding new column

I am trying to convert this Epoch date column into a useable date with seconds:
EPOCH COLUMN
1669749375000
 
I'm adding a column and using this formula
Useable Date = #datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, MyTable[EPOCH COLUMN]/1000)
 
I'm getting the following error:  The following syntax error occurred during parsing: Invalid token, Line 1, Offset 1, #.
 
 
1 ACCEPTED SOLUTION

@PowerBiPro2000 That's a reference to the step before the current step. You can just add a column and paste in this part of the formula: 

#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [EPOCH COLUMN]/1000))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
edhans
Super User
Super User

You don't need to include the table name. In fact, by using MyTable[EPOCH COLUMN] it is converting that to a list, then you are dividing a list by 1000.

 

Get rid of the MyTable designation. Is the data in this table? If not, you need to merge it in. You cannot reference data in other tables the same way you can DAX. 

As for the formula, see Working with Unix Epoch Time In Power BI — ehansalytics - I am not sure you need the 1000 divisor



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Greg_Deckler
Community Champion
Community Champion

@PowerBiPro2000 Oh, sorry, PQ, then this:

= Table.AddColumn(#"Changed Type", "Custom", each #datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [EPOCH COLUMN]/1000))

You don't use table references in PQ



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler   What does the "Changed Type" represent?  I can't get past "Expression.Error: The name 'Changed Type' wasn't recognized. Make sure it's spelled correctly"   I'm surprised how difficult it is to convert Epoch dates (at least it has been for me).

@Greg_Deckler As expected, it was my error!  However, now I am getting this error:  Expression.Error: The name 'Changed Type' wasn't recognized. Make sure it's spelled correctly.

 

What am I doing wrong?   Thank you for your help!

@PowerBiPro2000 That's a reference to the step before the current step. You can just add a column and paste in this part of the formula: 

#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [EPOCH COLUMN]/1000))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@PowerBiPro2000 Does this help? Unix2UTC and UTC2Unix - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors