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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
S_M
Helper III
Helper III

Time Intelligence: Adjusting time differences

Hi, 

 

Putting out a dax trick that i used to help adjust time differences for Time functions such as Yesterday / Today. 

 

In my dashboards, i usually show alot of tiles for data of Yesterday and Today - my timezone is GST, which is what applies to my data as well. I put my pbix model on a server that was UTC based, which is 4 hours behind - hence, everytime data in the pbix refreshed at 1am, because of the time difference, in my dashboards, yesterday's data (as per GST) would still show as 'today' because as per my server, at 1am GST, the server time was still 4 hours behind (i hope that makes sense). So, technically, for 4 hours, from 12am until 4am, my data for 'yesterday' and 'today' would be completely off. 

 

A very easy solution to adjust this, that i found after alot of brain wracking, was the following: 

 

datediff = DATEDIFF(tablename[Date],NOW()+TIME(4,0,0),DAY)

 

Essentially, this function adjusted the current server timezone by 4 hours (since i needed to add 4 hours to UTC to bring it to GST) and i simply used the result (0,1..)as a filter for Today / Yesterday respectively.

Being a comparative newbie at Dax, i really hope this helps someone who may be facing similar issues 🙂

1 REPLY 1
v-caliao-msft
Microsoft Employee
Microsoft Employee

Hi @S_M,

 

Thank you for your sharing.

 

Regards,

Charlie Liao

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors