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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
vkr057
New Member

Converting and showing times zones from MST,GMT and selected timezone based on the country selection

Hi Team,
I have a requirement of showing times zones( MST,GMT local timezone) based on the country selected in the Country filter.
Could we able to achieve by using Dax. we don't have previlige to create an custom column. 

 

Reference Image:

vkr057_0-1737113354522.png

 

2 ACCEPTED SOLUTIONS
rohit1991
Super User
Super User

HI @vkr057 ,

To dynamically display MST, GMT, and local times based on country selection in Power BI using DAX:

Create DAX Measures:

 

UTC : CurrentUTC = NOW() - TIMEZONEOFFSET(),


MST : MST_Time = CurrentUTC + (LOOKUPVALUE('Offsets'[MST Offset], 'Offsets'[Country], SELECTEDVALUE('CountryTable'[Country])) / 24),

GMT: GMT_Time = CurrentUTC,

Local Time: Local_Time = CurrentUTC + (LOOKUPVALUE('Offsets'[Local Offset], 'Offsets'[Country], SELECTEDVALUE('CountryTable'[Country])) / 24)

 

Add these measures to a table or card visual. Use the Country filter to dynamically update times. Ensure the Offsets table maps countries to their respective time zone offsets.

 

 

 

 

 

View solution in original post

AnkitKukreja
Super User
Super User

Hi! @vkr057 

 

Prepare a table with the mapping of countries to their respective time zones. For example:

 

Country TimeZoneOffset TimeZoneAbbreviation
USA (MST) -7 MST
UK (GMT) 0 GMT
India (IST) 5.5 IST

 

Add a Country Slicer to your report.

 

Measure for LocalDateTime =
VAR SelectedOffset = SELECTEDVALUE(TimeZoneTable[TimeZoneOffset])
RETURN
IF(
NOT ISBLANK(SelectedOffset),
DATEADD(Dataset[UTCDateTime], SelectedOffset * 60, MINUTE),
BLANK()
)

 

Measure  for MSTDateTime = DATEADD(Dataset[UTCDateTime], -7 * 60, MINUTE)

 

Measure for GMTDateTime = DATEADD(Dataset[UTCDateTime], 0 * 60, MINUTE)

 

 

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

View solution in original post

2 REPLIES 2
AnkitKukreja
Super User
Super User

Hi! @vkr057 

 

Prepare a table with the mapping of countries to their respective time zones. For example:

 

Country TimeZoneOffset TimeZoneAbbreviation
USA (MST) -7 MST
UK (GMT) 0 GMT
India (IST) 5.5 IST

 

Add a Country Slicer to your report.

 

Measure for LocalDateTime =
VAR SelectedOffset = SELECTEDVALUE(TimeZoneTable[TimeZoneOffset])
RETURN
IF(
NOT ISBLANK(SelectedOffset),
DATEADD(Dataset[UTCDateTime], SelectedOffset * 60, MINUTE),
BLANK()
)

 

Measure  for MSTDateTime = DATEADD(Dataset[UTCDateTime], -7 * 60, MINUTE)

 

Measure for GMTDateTime = DATEADD(Dataset[UTCDateTime], 0 * 60, MINUTE)

 

 

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904
rohit1991
Super User
Super User

HI @vkr057 ,

To dynamically display MST, GMT, and local times based on country selection in Power BI using DAX:

Create DAX Measures:

 

UTC : CurrentUTC = NOW() - TIMEZONEOFFSET(),


MST : MST_Time = CurrentUTC + (LOOKUPVALUE('Offsets'[MST Offset], 'Offsets'[Country], SELECTEDVALUE('CountryTable'[Country])) / 24),

GMT: GMT_Time = CurrentUTC,

Local Time: Local_Time = CurrentUTC + (LOOKUPVALUE('Offsets'[Local Offset], 'Offsets'[Country], SELECTEDVALUE('CountryTable'[Country])) / 24)

 

Add these measures to a table or card visual. Use the Country filter to dynamically update times. Ensure the Offsets table maps countries to their respective time zone offsets.

 

 

 

 

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors