Forum Discussion
Last Refresh Date - Alternative Solution
- 8 years ago
Hi Anonymous,
I've found this to be useful when I'm designing reports for worldwide customers. Rather than dealing with general timezones and DST/etc., just pull data related to the location itself.
Query:
let
Source = Web.Page(Web.Contents("http://localtimes.info/Asia/Saudi_Arabia/Riyadh/")),
Data1 = Source{1}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data1,{{"Column1", type text}, {"Column2", type text}}),
date = #"Changed Type"{1}[Column2],
time=#"Changed Type"{0}[Column2],
datetime=DateTime.FromText(date&" "&time)
in
datetime
Output example:
Hi Anonymous,
I've found this to be useful when I'm designing reports for worldwide customers. Rather than dealing with general timezones and DST/etc., just pull data related to the location itself.
Query:
let
Source = Web.Page(Web.Contents("http://localtimes.info/Asia/Saudi_Arabia/Riyadh/")),
Data1 = Source{1}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data1,{{"Column1", type text}, {"Column2", type text}}),
date = #"Changed Type"{1}[Column2],
time=#"Changed Type"{0}[Column2],
datetime=DateTime.FromText(date&" "&time)
in
datetime
Output example:
Thank you. I am not not sure, based on your description, that this will offer the results I am looking for. Perhaps I don't understand how to apply the solution.
- RMDNA8 years agoSolution Sage
Hi Anonymous,
Rather than using a DAX query, run the code above using "Advanced Editor" inside the Query Editor as a blank query.
What it's doing is, rather than pulling the date/time from your PC's internal clock, gets it from whatever site you use in the query and loads it into a table, which stays static until it's refreshed.
Step 1:
Enter the Query Editor and create a new blank query
Step 2:
Go to the Advanced Editor
Step 3:
Paste the code
Step 4:
You can load the result into your report and use it as a field in a visual