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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
Employee

@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

3 REPLIES 3
v-caliao-msft
Employee
Employee

@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

Thanks a lot.

Yes, that works. Thank you!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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