Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I know this is a common issue dealing with the conversion of times to UTC when publishing to server but I am hoping someone can help me with functions that pull current date and time.
I have a refresh date on my dashboard using the NOW() funtion to pull the time my dashboard is refreshed in to show users the last time the data was updated.
However when publishing to server of course even with the scheduled refreshes the time is adjusted for UTC.
Which is a time that hasn't even happened in my time zone yet. What formulas can I use to account for the UTC conversion but also still confirm I am pulling the exact time the dashboard was updated?
You can try with below M-Code :
let
Source = Json.Document(Web.Contents("http://worldtimeapi.org/api/timezone/America/Los_Angeles")),
datetime = Source[datetime],
DateTimeConverted = DateTimeZone.FromText(datetime)
in
DateTimeConverted
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it
Best Regards,
Sreeteja.
Community Support Team
Hi @laurahoff97 ,
Just wanted to check if you had the opportunity to review the suggestion provided?
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Hi @laurahoff97,
You can try with below M-Code. You can just replace your time zone in the below code.
let
Source = DateTimeZone.SwitchZone(DateTimeZone.UtcNow(), +5,30),
#"Converted to Table" = #table(1, {{Source}})
in
#"Converted to Table"
Syntax:
DateTimeZone.SwitchZone(dateTimeZone as nullable datetimezone, timezoneHours(+5) as number, optional timezoneMinutes as nullable number)
dateTimeZone: DateTimeZone.UtcNow()
timezoneHours: Set your time zone in hours
timezoneMinutes: Set your time zone in minutes
Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.
See this video
https://www.youtube.com/watch?v=CEJEtZu_xcg
Pleaase click thumbs up and [accept solution]
User | Count |
---|---|
84 | |
79 | |
71 | |
48 | |
43 |
User | Count |
---|---|
111 | |
54 | |
50 | |
40 | |
40 |