Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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:
Solved! Go to Solution.
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.
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)
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)
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.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.