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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Chapin4u
Microsoft Employee
Microsoft Employee

Subtract 6 hours

add_hours.png

 

 

 

 

I have the following query to show my last refresh in my report. When I upload the report to Power BI services (Web) show time 6 hours ahead of my local time, therefore, need to subtract 6 hours from my query. Please help me by guiding me how to subtract 6 hours from my query, thanks.

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@Chapin4u

 

Power BI Service is cloud service, you may get the time zone issue when using functions like NOW(), TODAY() since it takes the cloud server's date. You can use  DateTimeZone.SwitchZone function int Power Query to set your local time. Please refer to articles below:

 

Solving DAX Time Zone Issue in Power BI

Daylight Saving Time And Time Zones In M

 

If you just want to workaround this by substract 6 hours, you can create a custom column and add "+#duration(0,-6,0,0)" to your Date column.

 

5.PNG

 

Regards,

View solution in original post

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@Chapin4u

 

Power BI Service is cloud service, you may get the time zone issue when using functions like NOW(), TODAY() since it takes the cloud server's date. You can use  DateTimeZone.SwitchZone function int Power Query to set your local time. Please refer to articles below:

 

Solving DAX Time Zone Issue in Power BI

Daylight Saving Time And Time Zones In M

 

If you just want to workaround this by substract 6 hours, you can create a custom column and add "+#duration(0,-6,0,0)" to your Date column.

 

5.PNG

 

Regards,

Hi Simon,  

This looks good and easy to implement (DST issue aside) but I have a couple of questions:

 

I created custom columns in my tables to track whether a record should be counted in Today's reports and wondering how I would integrate your solution for the service/source time mismatch?  I actually have two columns in one of my tables one for Created Date and another for First Meeting Date.  Would I create your workaround for each column?

 

Any help/suggestions are greatly appreciated!

Mike

 

IsTodayCreated = IF (YEAR ( Opportunity[CreatedDate] ) = YEAR ( TODAY () )
           && MONTH ( Opportunity[CreatedDate] ) = MONTH ( TODAY () )
              && DAY ( Opportunity[CreatedDate] ) = DAY ( TODAY () ),
"Yes",
"No"
)

IsTodayCompleted =
IF (YEAR ( Opportunity[First_Meeting_Date__c] ) = YEAR ( TODAY () )
&& MONTH ( Opportunity[First_Meeting_Date__c] ) = MONTH ( TODAY () )
&& DAY ( Opportunity[First_Meeting_Date__c] ) = DAY ( TODAY () ),

"Yes",
"No"
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.