Forum Discussion

MarshallWilley's avatar
MarshallWilley
Regular Visitor
1 year ago
Solved

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...
  • rohit1991's avatar
    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.