Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
58 | |
36 | |
32 |
User | Count |
---|---|
90 | |
60 | |
60 | |
49 | |
45 |