cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
harshali
Frequent Visitor

Error message when converting unix time

I have a dataset coming from an SQL server in PowerBI. The dataset is currently 21,000+ rows. There is a column that has a Unix timestamp which I am trying to convert to regular timestamp. I am using the below formula:

 

#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [value])

 

When typing in the formula, BI does not show any error with the formula, however, when executed the following error message comes up:

 

"Expression.Error: The Duration operation failed because the resulting duration falls outside the range of allowed values."

 

How can I either expand the range or use a different formula that will not result in an error message?

1 ACCEPTED SOLUTION
v-caliao-msft
Microsoft
Microsoft

@harshali,

 

You can add a custom column

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

 Capture.PNG

 

Regards,

Charlie Liao

View solution in original post

2 REPLIES 2
v-caliao-msft
Microsoft
Microsoft

@harshali,

 

You can add a custom column

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

 Capture.PNG

 

Regards,

Charlie Liao

View solution in original post

Yes, that works. Thank you!!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.