How to convert UNIX time to Date in PowerBI for Desktop
11,414
Here's the function:
let q = (date) =>
let
Source = (#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, date))
in
Source
in
q
When defined, you can use it like this:
Author by
Eugene D. Gubenkov
Updated on June 28, 2022Comments
-
Eugene D. Gubenkov about 2 years
I'm using "Document DB connector" for Power BI as a source of data. Due to limitation (there is not native support for dates) on Document DB we store dates in UNIX format (amount of seconds since 1970) that allows to write date range queries against Document DB.
The problem is to convert this back to date on Power BI side. I'm looking for possibility of creating Computed column that will convert epoch time to date. Otherwise we will be forced to write to Document DB in both formats that looks redundant.
-
Eugene D. Gubenkov over 8 yearsThanks! Exactly what I was looking for! Can you recommend some resources to mine such information about Power BI from?
-
rocky over 8 yearsHere is a summary of resources I've been using when learning PowerBI.
-
Eugene D. Gubenkov over 8 yearsWow! Really appreciate your summarization!