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
Shine_456
Frequent Visitor

Convert UTC to Users time zone for date column in reports

Hi All,

 

I have query on Time zone isuue.

 

I have adate column of Created_Date with UTC time. With respective to user I need to convert UTC to their time zone in the report.

(Ex: A client has multiple Users wit different time zones. A User need to see date column as their local time zone. UTC + 5.30 timestamp)

 

Plz share ur ideas on this and DAX queries for this

 

Thanks

1 ACCEPTED SOLUTION
ppm1
Solution Sage
Solution Sage

Here is a measure expression that will dynamically change a UTC datetime to the local datetime. You could use a similar approach in a DAX column, but the user would have to refresh the pbix file for it to recalculate.

 

DT as Local = var dt = MIN(DateTimes[DateTimeColumn]) // any expression that results in a datetime value
var hrsdiff = DateDiff(UTCNOW(), NOW(), HOUR)
return dt + hrsdiff/24
 
Pat
 
Microsoft Employee

View solution in original post

2 REPLIES 2
ppm1
Solution Sage
Solution Sage

Here is a measure expression that will dynamically change a UTC datetime to the local datetime. You could use a similar approach in a DAX column, but the user would have to refresh the pbix file for it to recalculate.

 

DT as Local = var dt = MIN(DateTimes[DateTimeColumn]) // any expression that results in a datetime value
var hrsdiff = DateDiff(UTCNOW(), NOW(), HOUR)
return dt + hrsdiff/24
 
Pat
 
Microsoft Employee
Imrans123
Advocate V
Advocate V

Assuming you know where the User lives by a country column, I would create another dimension table listing down all countries in one column and their respective difference from UTC zone (in hours) in anoter column. Create a custom column in fact table, use the related value from that dimension table to add/subtract from the UTC time stamp. Name that column Local time or something and use that column where relevant.

 

It might affect your refresh time since it's data transformation, but because there's no DAX involved, the runtime will be fast. 

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.

Top Solution Authors