"current time"
1 TopicHow to display current time in your report using a measure, taking summer/winter time into account
Hi everyone! I recently wrote a DAX script for my PowerBI report's landing page to display the current time, but I quickly ran into the issue of taking into account the summer/winter time difference in Central-EU as the powerBI service always takes UTC as the current time. I searched far and wide for anything similar, and only found a time last-refreshed built in Power Query, which wouldn't produce the current time (unless you refresh every minute, hahaha). I thought I'd share it, in case anyone else would want to do the same 🙂 Here's the code, put into a measure: Tijd = var now = NOW() var beginsummertime = DATE(YEAR(NOW()), 3, 31) - WEEKDAY(DATE(YEAR(NOW()), 3, 31), 2) + 3/24 var beginwintertime = DATE(YEAR(NOW()), 10, 31) - WEEKDAY(DATE(YEAR(NOW()), 10, 31), 2) + 3/24 var timezonediff = IF(now > beginsummertime && now < beginwintertime, 2/24, 1/24 ) RETURN now + timezonediff This specific piece of code is made for the Dutch summer and winter timezones (CEST and CET), which change on the last sunday of March and October at 3 AM. Note that it's far from perfect, as it only re-calculates once the page is re-opened or refreshed. But it's the closest I could find to calculating the current time. If you have any questions, comments or tips please let me know!Solved1.7KViews0likes1Comment