Forum Discussion

keithpoplar's avatar
keithpoplar
Frequent Visitor
9 years ago

Power BI Desktop Date conversion error in French environment

 I have a report with date range as filters that works fine in the English environment. But it is causing an error in the French environment when the date filter is applied. 

 

With SQL Profiler, I found that Power BI is sending "CAST( N'2017-07-14 00:00:01' AS datetime)" command to SQL server. However, in the French environment, the SQL server is interpreting 14 as the month and failed to convert the string to date. Hence, Power BI desktop failed to visualize data.

 

How do I force Power BI sending date in ISO format? e.g. CAST( N'20170714' AS datetime)

5 Replies

  • for SQL connections you can choose language in Connections and Users

     

    if its a non english SQL then usually default language is non english like here in a newly created user on a german server

    If you cant change language in the connection in your case another possibility is create a different user with default language english

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Microsoft Employee

    Hi keithpoplar,

    First, in your french environment, restart your Power Bi desktop->files->Options and settings->Regional Settings->select your local based on your french environment as follows.



    Second, when you get data from SQL Server, edit the query navigator, right click the date column->Change type-> Using local->Ok as follows, you will get expected date format.




    More details, please review this article for further analysis.

    Best Regards,
    Angelia


    • keithpoplar's avatar
      keithpoplar
      Frequent Visitor

      Thank you very much for the reply. I tried these settings. It only changes the data format displayed in Power BI. But it doesn't change the date format in the query that was sent to SQL server when I apply a filter in Power BI desktop.

      • v-huizhn-msft's avatar
        v-huizhn-msft
        Microsoft Employee

        Hi keithpoplar,

        >> the date format in the query that was sent to SQL server  

        What's the mean of "sent to", it refers to the data was get from SQL Server, right?

        Best Regards,
        Angelia