Forum Discussion
MarshallWilley
1 year agoRegular Visitor
Dynamic parameter for datetime is 12 hours off
Hello, I'm having a problem with a report page that uses a dynamic parameter for the date from the selection on a slicer to change the SQL query. It appears to work except that the resulting data see...
- 1 year ago
Hi MarshallWilley ,
In your Power Query code, change the datetime format string from "hh:mm:ss" to "HH:mm:ss" to force 24-hour time (midnight), and always convert your parameter to midnight with this:DateTime.ToText(DateTime.From(Date.From(StartTimeParameter)), "yyyy-MM-dd HH:mm:ss")This will ensure your parameter always passes 00:00:00 (midnight) and fix the 12-hour offset problem.
rohit1991
1 year agoSuper User
Hi MarshallWilley ,
In your Power Query code, change the datetime format string from "hh:mm:ss" to "HH:mm:ss" to force 24-hour time (midnight), and always convert your parameter to midnight with this:
DateTime.ToText(DateTime.From(Date.From(StartTimeParameter)), "yyyy-MM-dd HH:mm:ss")
This will ensure your parameter always passes 00:00:00 (midnight) and fix the 12-hour offset problem.
MarshallWilley
1 year agoRegular Visitor
Thanks for your help, that worked!