Alternatively, you can use the TIMEVALUE function and. This Power Query M function reference guide is super helpful for learning more about available functions to use in your M formulas in Power Query Editor. Note that the later time is considered the greater value, so it is placed before the earlier time. ExamplesĪdd seven days (a week) = + #duration(7, 0, 0, 0)Ĭorrect a time zone – Add hours = + #duration(0, 5, 0, 0)Ĭorrect a time zone – Subtract hours and minutes = - #duration(0, 2, 30, 0) Learn more about M formulas and functionsĬheck out “ Add a custom column in Power BI Desktop” from Microsoft Docs to get started with creating custom columns using M formulas instead of DAX. #duration( days, hours, minutes, seconds)Īnd just change the – to + to add instead of subtract. Also update the numeric values in the #duration part to add or subtract days, hours, minutes, and seconds, respectively. You can change the column name to your own, of course. That example subtracts 5 hours from a column called Date/Time. The following was my solution for correcting a time zone issue in which the original data’s date/time column was 5 hours ahead. But I’m working on building more using M formulas as those are less resource-intensive and improve report performance. Previously, I shared how to transform date/time values in Power BI using DAX.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |