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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.