cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bmpi
Regular Visitor

Wrong date - one day difference

I have a Power App integrated in a Power BI file, where the user can choose a record from a table (to the left) and the info from the record is added to the app and the user are going to fill the last field manually.

 

However, the date is one day off and I do not understand where in my app can fix this error.

 

The table to the left and the app to the right with the wrong date in the date field:

 

bmpi_1-1655968865931.png

 

The code is a variable:

Set(VAR_Date, Text(ThisItem.Date, "dd.mm.yyyy")

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @bmpi,

Please check your BI report time zone settings, make sure the time zone within the Power BI report data is the same as the one configured with the Device running PowerApps.

 

And if that is not your scenario, then please consider take use of TimeZoneOffset function together with the DateAdd() to convert the data into proper time.

For the usage, please see:

DateAdd, DateDiff, and TimeZoneOffset functions in PowerApps

 

For example:

Converting from UTC

To convert from UTC, subtract the TimeZoneOffset (by adding the negative) for the given time.

For example, imagine the UTC date and time July 15, 2013, 8:02 PM is stored in a variable named StartTime. To adjust the time for the user's time zone, use:

  • DateAdd( StartTime, -TimeZoneOffset( StartTime ), Minutes )

Note the negative sign before TimeZoneOffset to subtract the offset rather than add it.

Best Regards,
Qi

View solution in original post

5 REPLIES 5
bmpi
Regular Visitor

Anyone?

Aapok
Resolver II
Resolver II

What is the data source for the Power BI report? Is there a reason you're setting the variable as text? Off the top of my head this looks like a timezone issue between Power BI and Power Apps but it's hard to say with the information provided.

bmpi
Regular Visitor

The data source in the Power BI report is a tabular model.

I have created a variable to show the date chosen in the Power BI report (among other parameters):

Set(VAR_TransportationDay, Text(ThisItem.'Transportation Day', "dd.mm.yyyy"))

Is there another syntax I should instead of text? 

(I have been back and forth with many attempts to solve this date-issue, that I actually don't remember why I ended up with text..)

v-qiaqi-msft
Community Support
Community Support

Hi @bmpi,

Please check your BI report time zone settings, make sure the time zone within the Power BI report data is the same as the one configured with the Device running PowerApps.

 

And if that is not your scenario, then please consider take use of TimeZoneOffset function together with the DateAdd() to convert the data into proper time.

For the usage, please see:

DateAdd, DateDiff, and TimeZoneOffset functions in PowerApps

 

For example:

Converting from UTC

To convert from UTC, subtract the TimeZoneOffset (by adding the negative) for the given time.

For example, imagine the UTC date and time July 15, 2013, 8:02 PM is stored in a variable named StartTime. To adjust the time for the user's time zone, use:

  • DateAdd( StartTime, -TimeZoneOffset( StartTime ), Minutes )

Note the negative sign before TimeZoneOffset to subtract the offset rather than add it.

Best Regards,
Qi

Thanks! 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,424)