Date Calculation in DAX

Hi,

I have a column value (START_MOMENT) which represents the number of minutes since midnight 12/30/1899 GMT.

I’d like to convert that (i.e. add a new column) using DAX rather than Power Query Editor to a datetime value.

The attached file has a handle of rows of the START_MOMENT “minutes since 12/30/1899” column and the converted Start Moment Date result. It also shows the SQL associated with the datetime conversion.

I’m looking for the approach to doing this in DAX for a Power BI report. With the solution. do you have any tips or references for translating SQL statements into DAX column/measure logic?

Thanks,
Kevin
Start Moment Values.xlsx (361.7 KB)

Hi @kkieger,

Welcom to the forum !

I found a solution to your problem.

First I calculated the number of days related to your “START MOMENT”.
image

Then I calculated the number of hours and minutes that remain.
image

And finally, I’ve just added all the results to your initial date.
image

Final result :
image

Here is my solution :
Start Moment Values.xlsx (361.7 KB)
Untitled3.pbix (39.1 KB)

For your other question of translating SQL statement into DAX I don’t know if it’s possible to do that, except knowing both SQL and DAX and try to do the same thing in DAX…

I hope it will help you.

Best regards,
Joaly

6 Likes

Awesome. Thank you. Solution complete.