To work with time zones, we first need to agree upon a standard list of time zones. This is our Timezones.csv file. This can actually be problematic as time zones are sometimes listed by country and, at other times, by abbreviations. Even worse, there can be multiple, duplicate time zone abbreviations with different offsets. In addition, time zone offsets are generally expressed in the hours and minutes (HH:mm) format based upon UTC. To make the calculations easier, the Timezones.csv file lists only unique time zone abbreviations and specifies offsets in a form that is more compatible with DAX. Hence, if a time zone offset is -8 hours and 45 minutes (8:45), this is expressed in the time zone table as -8.75 (minus eight hours and .75 of an hour (45/60)). Since we have expressed our offset in this manner, we can simply divide this number by 24 to arrive at a fraction of a day, which is how DAX stores times internally. This is our DAX UTC Offset column in the R09_Timezones table.
Once we have this column in place, we can use this column in our measure, TZ Convert. The TZ Convert measure first specifies our target or destination time zone—in this case, Australian Central Western Standard Time (ACWST). We also get our current working time, __SourceTime, and our current working time zone, __SourceTZ. We now use the LOOKUPVALUE function to look up DAX UTC Offset in the R09_Timezones table for both our source and destination time zones and store these values in the __SourceOffset and __DestOffset variables respectively. In this particular case, Eastern Standard Time (EST) has an offset of -5 hours (-.208333) from UTC while ACWST has an offset of 8.75 hours (.3645833).
The next step is to convert our source timestamp from the source time into UTC time. Because offsets are expressed in the difference from UTC to the specified time zone, we need to multiply the source offset, __SourceOffset, by -1 and add the result to our source timestamp, __SourceTime. -1 is necessary since we are going from the source time zone to UTC! We store the resulting value in the __UTCTime variable. After that, we can return our final calculation, which is to simply add our destination offset, __DestOffset, to __UTCTime. In this case, we do not need -1 because we are going from UTC to our destination time zone.