Forum Discussion

speedyspeedstar's avatar
speedyspeedstar
Regular Visitor
8 years ago
Solved

Power BI Embedded DateTime Json filter translates to UTC+10

I have imported some date-times from SQL Server e.g.   2016-12-07 00:00:00.000 2016-06-08 00:00:00.000 2016-01-20 00:00:00.000   The import works fine and in Power BI Desktop/service I can see ...
  • Eric_Zhang's avatar
    Eric_Zhang
    8 years ago

    speedyspeedstar wrote:

    My data is imported from SQL with date/time data i.e.


    2016-12-07 00:00:00.000
    2016-06-08 00:00:00.000
    2016-01-20 00:00:00.000

     

    and Power BI Desktop and service interprets this correctly.

     

    I embed the report into an MVC application application and I construct this filter :

     

    [
    {$schema:"http://powerbi.com/product/schema#advanced",
    target {table:"ReportingClientActivityReport",column:"InvoiceDate"},
    logicalOperator:"And",
    conditions:
    [{operator:"LessThanOrEqual",value:"2017-10-22 00:00:00Z"},
    {operator:"GreaterThanOrEqual",value:"2017-10-16 00:00:00Z"}]} ]

    I put this filter in the json object for the power BI embedded iframe but when my embedded report comes back it's filtered to UTC+10 (server is in Brisbane)

     

    How do I communicate in the filter that I want this particular DateTime without offset


    speedyspeedstar

    The datetime format trailed with "Z" indicates a UTC format, based on my test, to get the server local datetime, you just remove the trailing "Z".

    [
    {$schema:"http://powerbi.com/product/schema#advanced",
    target {table:"ReportingClientActivityReport",column:"InvoiceDate"},
    logicalOperator:"And",
    conditions:
    [{operator:"LessThanOrEqual",value:"2017-10-22 00:00:00"},
    {operator:"GreaterThanOrEqual",value:"2017-10-16 00:00:00"}]}
    ]

    See my test without VS with trailing "Z"