Forum Discussion
Power Bi Dynamic Time Zone Transformation
- 1 year ago
Thanks Musab-Ali for the follow-up, I completely understand your scenario now. Since your dashboard depends on the User_Joined_Date field and you need full interaction with a third-party date picker and slicers, the best way to support dynamic time zone switching (without breaking model relationships) is to handle the timezone transformation at the data level instead of relying on dynamic measures.
Here’s the solution that works perfectly with slicers, relationships, and full dashboard interactivity:
- In Power Query, create multiple versions of the Users table — one for each timezone you want to support (e.g., PST, UTC, IST, etc.).
- In each copy, add a new column that adjusts the User_Joined_DateTime_UTC based on that timezone's offset.
- Add a [TimeZone] column to identify the timezone of each record.
- Append all these tables into a single combined table (Users_AllTZ).
- In your model, relate the User_Joined_LocalDate (from the adjusted datetime) to your existing Date table.
- Add a slicer using the [TimeZone] column. When a user selects a timezone, the whole dashboard (including visuals and the date picker) will reflect the adjusted local time.
This approach avoids the limitations of dynamic measures, ensures that your date picker continues to work properly, and lets users switch timezones across the entire dashboard without needing to duplicate visuals or reports.
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.Best Regards,
Tejaswi.
Community Support
Hi Musab-Ali,
Thanks for reaching out to the Microsoft fabric community forum.
To display the user count by local join date based on the selected time zone in Power BI, here’s the approach that works perfectly:
First, create a Date table using the CALENDAR() function and mark it as a Date table. Then, create a TimeZones table with two columns: TimeZoneName (e.g., PST, EST, IST) and OffsetHours (the UTC offset for each time zone).
Next, add a slicer to the report using the TimeZones[TimeZoneName] field, so users can select the desired time zone dynamically.
To calculate the user count adjusted to the selected time zone, use this DAX measure:
User Count by LocalDate =
VAR Offset = SELECTEDVALUE(TimeZones[OffsetHours], 0)
RETURN
CALCULATE(
COUNTROWS(Users),
ADDCOLUMNS(
Users,
"LocalDate", DATEVALUE(Users[User_Joined_DateTime_UTC] + Offset / 24)
),
TREATAS(VALUES('Date'[Date]), [LocalDate])
)
Finally, use Date[Date] (or Day, Month, etc.) from your Date table in your visuals, along with this measure. The result will show the user count by local join date, dynamically adjusting based on the selected time zone from the slicer. Simple, effective, and works great with multiple time zones.
Please find the attached pbix file for your reference.
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Best Regards,
Tejaswi.
Community Support