Adjusted Datetime Based Upon Selected Time Zone
![Adjusted Datetime Based Upon Selected Time Zone /adjusted-datetime-pbi/hugo_pbi_adjusted_dt.png](/adjusted-datetime-pbi/hugo_pbi_adjusted_dt.png)
Have you had an opportunity that you needed to develope a report which would be consumed globally? If there is datetime data, you need to be cautious how you would show it in your report.
Will it be based upon UTC? Local time? I came up with an idea that it allows an end user to choose their own timezone so that datetime in a report would be converted by the user’s own choice.
Preparing a table of timezone
![](img/pq_tz.png)
Power Query - Time Zone Table
First of all, let’s furnish a table with time zone data, name of time zone and utc offset value would be the minimum requirements. You may scrape or download data from the Internet.
Allow report consumers to choose their own time offset
![](img/pq_dt_data.png)
Power Query - Sample DateTime
Let’s pretend you have a dataset containing datetime data. The datetime data should be set UTC time.
Once you loaded a table into Power BI, let’s create a measure. By the way, you do not need to make a relationship in the model as lookup function will be utilized here.
Do not forget to add a slicer with timezone name.
![](img/adj_jst.png)
Time zone slicer and utc and adjusted datetime table
Now you are all set. Once you puck a timezone in the slicer, you would find the datetime value is adjusted accordingly.
|
|