Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Using slicer to change date column into user local time

I have a dataset that uses Direct Query. I have a timestamp column and I am trying to add another column that will show the local time of that column for differnt users based on the selection from the slicer (which contains the list of countries). The new column should show the timezone based on the slicer list but I am not getting the right timezone. 

 

I managed to connect to a timezonedb that will give me a list of offset for different timezones based on this article in this link: https://whitepages.tygraph.com/2020/10/dynamic-time-zone-conversion-using-power-bi/

 

This is what I have tried:

DAX measure: selected_offset = MAX(global_timezone[offset_days])
New column(local_time): date_column + [selected_offset]
 
**Start Timestamp: Timestamp column is saved using UTC+0
**selected_offset = SG timezone (UTC+8) = 0.3333
 
Desired output: 
 
Start Timestamp  selected_offset local_time
04/13/2022 2:38 0.333333333 04/13/2022 10:38
04/13/2022 2:37 0.333333333 04/13/2022 10:37
04/13/2022 2:37 0.333333333 04/13/2022 10:37
 

Please let me know how to get the correct date time for local_time column based on slicer selection. Most solutions I found offer solution in Power Query which is something I cannot use at the moment due to DQ I am using for this dataset. Thanks!

 

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please use the measure rather than calculated column.

 

local_time = MAX ( 'Table'[Start Timestamp] ) + MAX ( global_timezone[offset_days] )

vkkfmsft_0-1649992151657.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please use the measure rather than calculated column.

 

local_time = MAX ( 'Table'[Start Timestamp] ) + MAX ( global_timezone[offset_days] )

vkkfmsft_0-1649992151657.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.