"time zone"
3 TopicsHow 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.7KViews0likes1CommentDashboard unable to refresh
Hi there, We have Power BI reporting server May 2022 version (we plan upgrade soon). On this server we have a report which is unable to refresh. It produces the following message. DataFormat.Error: We couldn't parse the input provided as a DateTimeZone value.. 31-12-2019 23:59:59. ;We couldn't parse the input provided as a DateTimeZone value.. The exception was raised by the IDbCommand interface. This is a parameter in the model with name DateFilter and has the value '2019-12-31T23:59:59.99Z'. Later this value is converted using ' DateTimeZone.FromText(DateFilter)'. This is where it goes wrong, but I don't know what. But when I open the dashabord on my laptop in Power BI, it works fine. The server is configured with UTC time zone. What can be wrong ?? Any help is welcome. Thanks in advance.. JaccoSolved803Views0likes2CommentsConvert date field to a selected date time zone to calculate adjusted values
Hello, My overall goal is to have users select their desired time zone and see the number of calls answered, based on their time zone selected. My thought process was to convert the call_date time based on the time zone selected from a separate table called 'Time Zones.' This time zone table accounts for Daylight savings and contains all time zone offsets in minutes, depending on where each call_date is between the begin_date and end_date. Here is an example from the Time Zone table: I did this by creating a measure: VAR CurrentDate = MAX('Call Segment'[call_date]) VAR TheZone = IF(ISBLANK(SELECTEDVALUE('Time Zones'[Time Zone Name])), "Greenwich Standard Time", SELECTEDVALUE('Time Zones'[Time Zone Name])) VAR TimeConversion = MAXX( FILTER( 'Time Zones', 'Time Zones'[Time Zone Name] = TheZone && 'Time Zones'[begin_date] <= CurrentDate && 'Time Zones'[end_date] >= CurrentDate ), 'Time Zones'[UTC Offset Minutes] ) RETURN IF( TimeConversion < 0, CurrentDate - TIME(0, ABS(TimeConversion), 0), CurrentDate + TIME(0, TimeConversion, 0) ) The part I am struggling with is counting the number of Call IDs that fall within the newly converted time. I need to show Call Counts (Sum of Call IDs) by this new date, exaclty like below but will dynamically adjust based on that Time Zone: Any help would be greatly appreciated!778Views0likes3Comments