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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.