Calculate Time zone from two columns and display in Power BI
Apr 16, 2021
Once we got a situation to display time zone from the data source. We use Azure Data Explorer(ADX) as the source for our data. We have a local timestamp and global time stamp columns on our data.
So to identify the data, we created a measure with below condition. This will calculate the difference between the timestamps
TimeDifference = DATEDIFF(CONVERT(VALUE(FIRSTNONBLANK(TableName[GlobalDateTime], 1)), DATETIME), CONVERT(VALUE(FIRSTNONBLANK(TableName[LocalDateTime], 1)), DATETIME), MINUTE)/60
This will get the time difference between the first time zones on the data. Now to display the same we use the second measure as below
TimeDifferenceDisplay = CONCATENATE(IF([TimeDifference] >0 , “GMT + “ , “GMT “), [TimeDifference])
Now we can see the time zone difference on your power bi