Forum Discussion
How to change column datetimezone to a localtime column?
Hi community,
I have an issue on converting a column in datetimezone format to a localtime column on a report in a directquery mode in PBI Desktop with the 'DateTimeZone.ToLocal' formula, when i try to do this a message appears and I have to delete the localtime column. Any idea?
Hi Anonymous,
As indicated in the message, 'DateTimeZone.ToLocal' function is not supported in DirectQuery mode currently.
In this scenario, I would suggest you to change the date time on the source side if possible, or you can use DAX to create a calculate column to manually change the date time to local. The formula below is for your reference.:smileyhappy:
Column = Table1[LocalTime] - TIME ( 6, 0, 0 ) --the UTC
Regards
2 Replies
- v-ljerr-msft
Microsoft Employee
Hi Anonymous,
As indicated in the message, 'DateTimeZone.ToLocal' function is not supported in DirectQuery mode currently.
In this scenario, I would suggest you to change the date time on the source side if possible, or you can use DAX to create a calculate column to manually change the date time to local. The formula below is for your reference.:smileyhappy:
Column = Table1[LocalTime] - TIME ( 6, 0, 0 ) --the UTC
Regards
- AnonymousNot applicable
Thank you for your comment, I´m going to use it. I think I have to do a work around because the report its going to be used in several countries with diferents UTCs. Now, I have another question, how can I get the local UTC in order to do the conversion time?