Forum Discussion

SahilKothekar's avatar
SahilKothekar
Frequent Visitor
1 month ago
Solved

Switch Time Zone on DateTime Columns based on User Selection

Hi All, I have a requirement from business to change the timezones of date time columns based on user selection like if user selects EST or CST (there are multiple timezones that can be selected) all...
  • MohamedFowzan1's avatar
    1 month ago

    Keep the data stored in UTC.

     

    Create a disconnected Time Zone table (EST, CST, PST, etc.) for the user to select from.

    Apply the selected offset (ideally from a lookup table that includes DST rules) in measures for display.

     

    Keep the date slicer based on the original UTC date or use a dedicated local calendar generated for the selected time zone.

     

    The tricky part is exactly what you mentioned: when a timestamp crosses midnight after conversion, the local date changes. If the slicer remains on the UTC date, users can miss records around the day boundary. To avoid this, the slicer also needs to be based on the converted local date rather than the original UTC date.

     

    One additional consideration is how many time zones you need to support. If it's only a handful (e.g., EST, CST, PST, UTC), precomputing the local date/time columns can be a practical solution. If you need to support many time zones or frequent changes, I'd push the conversion upstream (SQL/Fabric/Dataflow) using a proper time zone reference table that includes DST rules rather than trying to manage it in DAX.

    Also, if the slicer truly needs to filter by the selected local date, I don't think there's a purely DAX-based solution with the native slicer because slicers operate on columns, not measures. At that point, the model needs to be designed around the local date requirement rather than just converting the displayed timestamps.