Forum Discussion
Problem with DateTime value if read from SharePoint
- 3 years ago
I found a solution (workaround) by myself. Maybe it is not the best way, but seams to be working.
What I do is I create calculated column in the SahePoint, explicitly forcing datetime value to be converted into decimal datatype at the SharePoint site.
Later, in Power Query, I just convert the correctly-converted-decimal-number into DateTime datatype, and I get what I need in the correct way.
Hi vlialko ,
It should be that simple, but unfortunately never is.
Check these regional settings and see if there's anything obvious there:
Failing that, I think you'll have to manually adjust values in your code with the DateTimeZone functions, which is generally best practice anyway to account for global scalability.
Pete
I have tested with changing the languge too, but the problem is till there
Actually, before posting on this forum I have already tested playing with regional settins, and had no sucess 😞 Now I repeat my steps with you, just to have more pedagociall problem introduction to the uses on this forum.
Ok, if we eliminate Regional settings as the root cause, then how should I think/reason, as what shuld be my next logical step ??? I mean I have a lis of M functions,
https://docs.microsoft.com/en-us/powerquery-m/datetimezone-functions
My Power BI Report will be published on PBI Webservices, having users/visitors from all arround the World (from different Time zones).
In My DataModel I have DateTime, which I cannot explain as it is shifted by 2 hours, but's let's accept it as it is for a while. So what shoud I try to do with that DateTime value now?
Lets say:
dateTime1 = "2022-08-25 14:00:00" //this is for some reasons wrong
dateTime2 = f...(dateTime1) //now we have "2022-08-25 16:00:00" and this is correct
what function/functions do I need to apply?
Thanks