Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to change column datetimezone to a localtime column?

screenshot.jpg

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?

 

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
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.Smiley Happy

Column = Table1[LocalTime] - TIME ( 6, 0, 0 ) --the UTC

Regards

View solution in original post

2 REPLIES 2
v-ljerr-msft
Employee
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.Smiley Happy

Column = Table1[LocalTime] - TIME ( 6, 0, 0 ) --the UTC

Regards

Anonymous
Not 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?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.