<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problems with DAX, SQL and locale in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/196600#M86471</link>
    <description>&lt;P&gt;I&amp;nbsp;forgot to mention it in my original post, but I've already tested changing the data type of the date column&amp;nbsp;in PowerBI using both Norwegian and English&amp;nbsp;American locale. PowerBI correctly interprets the column as a date column upon querying the database.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried changing the locale of the whole model between Norwegian and English American, with different combinations on the column locale. And measures in direct query&amp;nbsp;mode are unrestricted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;There should not be any problems with the way the column data types are defined in SQL. Here is an image of the table used in the example measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the dates in the database are automatically recognized as dates in PowerBI or at least so it says. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to create the measure works just fine:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CurrentBudget = SUMX(FILTER(DimBudget;DimBudget[TimeAltKey] &amp;lt;= TODAY());DimBudget[BudgetTarget])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding it to a visualization gives me this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change the locale formats of my local computer where I'm running Power BI Desktop to English (United States):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Refreshing the model in PowerBI:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I've done no changes on the SQL side to get this working. I've tried changing the locale of the whole PBIX-file, and the columns to both English and Norwegian without&amp;nbsp;it helping. And if I change from DQ to Imported it works just fine without changing&amp;nbsp;any locale settings in PowerBI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As an additional test, I connected to the old data warehouse, where I know that things have worked in the past, and I get the same issue when creating the same measure but on a different table. Change my computers locale format to English, and it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've even tried restoring the DWH database on an instance on the same computer as where I'm running PowerBI, and the exact same problem occurs, with the exact same remedies for getting it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried creating a measure as so: DD = Today(), and changed the format of that measure to match the format of the time column, and using that measure instead of today() in my original measure. Works fine in American, doesn't work in Norwegian, but the DD measure iself works in both OS locale format settings.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2017 10:01:16 GMT</pubDate>
    <dc:creator>apollnor</dc:creator>
    <dc:date>2017-06-19T10:01:16Z</dc:date>
    <item>
      <title>Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/195659#M86063</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Server OS&lt;/STRONG&gt;: Windows Server 2016&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Server Region &amp;amp; Language&lt;/STRONG&gt;: Norway&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Server Formats&lt;/STRONG&gt;: Norwegian Bokmål (Norway)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SQL Instance Version&lt;/STRONG&gt;:&amp;nbsp;Microsoft SQL Server 2016 (SP1)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Instance Collation&lt;/STRONG&gt;:&amp;nbsp;Danish_Norwegian_CI_AS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Client Computer OS&lt;/STRONG&gt;: Windows 10 x64 Pro&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Client Computer&amp;nbsp;&lt;/SPAN&gt;Region &amp;amp; Language&lt;/STRONG&gt;: Norway&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Client Computer&amp;nbsp;&lt;/SPAN&gt;Formats&lt;/STRONG&gt;: Norwegian Bokmål (Norway)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble with getting the locale settings in PowerBI to work and to be fair, I don't&amp;nbsp;really understand why I have to change them in this case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I connect directly to the SQL Server (DQ), and I change the locale of the PBIX itself to Norwegian, as well as all date columns I use in all fact and dim tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having done this, the following measure still fails with the good old (Could not convert nvarchar to date format...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;CurrentBudget = SUMX(FILTER(DimBudget,DimBudget[TimeAltKey] &amp;lt;= TODAY()),DimBudget[BudgetTarget])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing the query to a more&amp;nbsp;advanced version, using the date dimension&amp;nbsp;to iterate returns the sum of the budget for as far as the filter context of the report allows, for example, the whole of 2017, even if I have limited the result to the current date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;CurrentBudget = SUMX(FILTER(DimBudget,RELATED(DimTime[FullDate]) &amp;lt;= [Today]),DimBudget[BudgetTarget])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change the formats on my client computer operating system to use American date format and punctuation, it all works...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The original content of the data warehouse come from CSV-exports and are loaded into the table in the database using SSIS packages that I've built using Visual Studio 2015.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 13:15:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/195659#M86063</guid>
      <dc:creator>apollnor</dc:creator>
      <dc:date>2017-06-16T13:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/196449#M86405</link>
      <description>&lt;P&gt;If I do a simple test and import the data from only the table the measure needs to work with, I have no problems using Norwegian Locale. However, If I do the same, only in DQ mode, I'm back to getting the error message...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value... The exception was raised by the IDataReader interface.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As the source SQL-server is my own, I have also tried to change the language of the SQL instance to my own native, just to check if it had any effect, but it did not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a similar post on the forums, where the exact same problems are described:&amp;nbsp;&lt;A href="http://community.powerbi.com/t5/Desktop/Locale-settings-not-working/m-p/49588/highlight/true#M19771" target="_blank"&gt;http://community.powerbi.com/t5/Desktop/Locale-settings-not-working/m-p/49588/highlight/true#M19771&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 08:07:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/196449#M86405</guid>
      <dc:creator>apollnor</dc:creator>
      <dc:date>2017-06-19T08:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/196562#M86455</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13401" data-lia-user-login="apollnor" class="lia-mention lia-mention-user"&gt;apollnor&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;According to my test, the dates will convert automatically if they are in the formats that can be converted. Sometimes the convention will return wrong date but it works unless the data is out of range. It’s hard to say what went wrong. Please check these things below.&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Please change the “Data type” of the column into Date in “Modeling” ribbon.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Please check the dates in DB if some of them is out of range. For instance, “2017-02-30” can’t be converted. &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Change data type of that field into “Date” in the DB if possible. So we can make sure Dates&amp;nbsp;are correct in the DB.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Please post some snapshot here. (Error message, data in the DB, data in the report.)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards!&lt;/P&gt;&lt;P&gt;Dale&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 09:18:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/196562#M86455</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2017-06-19T09:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/196600#M86471</link>
      <description>&lt;P&gt;I&amp;nbsp;forgot to mention it in my original post, but I've already tested changing the data type of the date column&amp;nbsp;in PowerBI using both Norwegian and English&amp;nbsp;American locale. PowerBI correctly interprets the column as a date column upon querying the database.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried changing the locale of the whole model between Norwegian and English American, with different combinations on the column locale. And measures in direct query&amp;nbsp;mode are unrestricted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;There should not be any problems with the way the column data types are defined in SQL. Here is an image of the table used in the example measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the dates in the database are automatically recognized as dates in PowerBI or at least so it says. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to create the measure works just fine:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CurrentBudget = SUMX(FILTER(DimBudget;DimBudget[TimeAltKey] &amp;lt;= TODAY());DimBudget[BudgetTarget])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding it to a visualization gives me this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change the locale formats of my local computer where I'm running Power BI Desktop to English (United States):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Refreshing the model in PowerBI:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I've done no changes on the SQL side to get this working. I've tried changing the locale of the whole PBIX-file, and the columns to both English and Norwegian without&amp;nbsp;it helping. And if I change from DQ to Imported it works just fine without changing&amp;nbsp;any locale settings in PowerBI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As an additional test, I connected to the old data warehouse, where I know that things have worked in the past, and I get the same issue when creating the same measure but on a different table. Change my computers locale format to English, and it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've even tried restoring the DWH database on an instance on the same computer as where I'm running PowerBI, and the exact same problem occurs, with the exact same remedies for getting it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried creating a measure as so: DD = Today(), and changed the format of that measure to match the format of the time column, and using that measure instead of today() in my original measure. Works fine in American, doesn't work in Norwegian, but the DD measure iself works in both OS locale format settings.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 10:01:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/196600#M86471</guid>
      <dc:creator>apollnor</dc:creator>
      <dc:date>2017-06-19T10:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/197065#M86691</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13401" data-lia-user-login="apollnor" class="lia-mention lia-mention-user"&gt;apollnor&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I reproduced this problem. The trick is the formats of date are different from each other of the DB and PBI. The workaround is changing&amp;nbsp;the format of the DB or the PBI to make them same. &amp;nbsp;This expression can show up the default format of the DB.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;select name,alias, dateformat 
    from syslanguages 
    where langid= 
         (select value from sysconfigures where comment='default language');&lt;/PRE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will submit a report internally&amp;nbsp;and will post here when I get new information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards!&lt;/P&gt;&lt;P&gt;Dale&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 02:50:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/197065#M86691</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2017-06-20T02:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/197282#M86789</link>
      <description>&lt;P&gt;Does this mean that the locale settings in PBID are not working properly at the moment when running queries directly to the DB? I'm pretty sure this problem existed before but was remedied when the locale settings were introduced, but I might be incorrect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the results from your query on my server (and my client's instance):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you say I can change the format in PBI as a workaround, what exactly&amp;nbsp;do you mean step by step? For now, the only capable solution I've found is running the report in imported mode.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="26842" data-lia-user-login="jmatta" class="lia-mention lia-mention-user"&gt;jmatta&lt;/a&gt;&amp;nbsp;seems to have the same problem, only his source is in the cloud.&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.powerbi.com/t5/Issues/Direct-Query-AzureDW-and-Regional-Date-Formats/idi-p/158421#comments" target="_blank"&gt;http://community.powerbi.com/t5/Issues/Direct-Query-AzureDW-and-Regional-Date-Formats/idi-p/158421#comments&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for bringing this in :)&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 07:54:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/197282#M86789</guid>
      <dc:creator>apollnor</dc:creator>
      <dc:date>2017-06-20T07:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/197429#M86861</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13401" data-lia-user-login="apollnor" class="lia-mention lia-mention-user"&gt;apollnor&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, you had tried it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"Change the locale formats of my local computer where I'm running Power BI Desktop to English (United States):"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The format of date in DB is "mdy" while in the client is "dmy". This is the root cause. Changing it in the DB may avoid changing it in many clients. BUT THIS IS NOT A GOOD IDEA DOING IT IN A PRODUCTION DB. Usually, we create a new one with the proper format if possible. Please attention: This is not an advice from a database professional.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards!&lt;/P&gt;&lt;P&gt;Dale&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 10:04:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/197429#M86861</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2017-06-20T10:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/197439#M86864</link>
      <description>&lt;P&gt;I see. I am the one building the DWH so changing it wouldn't be a major problem, just time-consuming and perhaps changing the defaults of the DWH will affect something else in the future, so I would rather stick to having consuming applications adapt to the DB time format.&lt;BR /&gt;&lt;BR /&gt;But am I correct in assuming that the locale settings in the PBIX or locale transformed date column should adjust for this, however, they are not, and the team will have a look at it? Not sure if I should keep working on a permanent workaround or wait for a new release, see :)&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 10:11:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/197439#M86864</guid>
      <dc:creator>apollnor</dc:creator>
      <dc:date>2017-06-20T10:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/197491#M86895</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13401" data-lia-user-login="apollnor" class="lia-mention lia-mention-user"&gt;apollnor&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will post here as soon as I get any updates. You could try it to get it to work for now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards!&lt;/P&gt;&lt;P&gt;Dale&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 11:21:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/197491#M86895</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2017-06-20T11:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/198929#M87526</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13401" data-lia-user-login="apollnor" class="lia-mention lia-mention-user"&gt;apollnor&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I’ve got response from the Product Team.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Based on the error message, the column 'test'[datetimes] is of data type NVARCHAR that cannot be converted to DATETIME on SQL Server side. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Unlike Import models where calculations are performed on PowerBI side, DirectQuery models push as much calculation to the underlying database as possible. In this case, the comparison operation is pushed to SQL Server and it's up to SQL Server to convert NVARCHAR to DATETIME based on its own setting. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You needs to work with your SQL Server DBA to find out the string format of the column and how to extract DATETIME values from it. As a general advice, you&amp;nbsp;should work with your DBA to find out if they can create a DATETIME column directly inside the SQL Server database to have the best performance since you want to filter by that column, SQL Server cannot deliver the best query performance if a filter operation needs to perform data type conversion first.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;BR /&gt;Herbert&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 02:25:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/198929#M87526</guid>
      <dc:creator>v-haibl-msft</dc:creator>
      <dc:date>2017-06-22T02:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/199037#M87568</link>
      <description>&lt;P&gt;I'm guessing the error message the team was looking at here, was the one you produced during the reproduction of my problem? If so did you set your date column&amp;nbsp;('test'[datetimes]) to be NVARCHAR, or is the team just assuming this base on the error message?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm asking because I posted a screenshot of the column types on the database I'm connected to, where you can without a doubt see that the date column is defined with the date data type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;Further tests I've done have involved publishing the report with a live query to the DB via a Data Gateway on the SQL Server, and then opening it with a &lt;FONT size="3"&gt;browser&lt;/FONT&gt; on the same machine as where I use PBID. No problem at all, everything works. The problem only persists in PBID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in order to make sure this doesn't have anything to do with me using a 'date' column instead of a 'datetime' column I've transported all the data from DimBudget to a test database on the same server, where I now have the following columns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Extract/Load Script (FYI):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;SET NOCOUNT ON;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;DECLARE @date date, @datetime datetime, @money money;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;DECLARE test_cursor CURSOR&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;FOR &lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;SELECT [TimeAltKey] as [date],CONVERT(datetime,[TimeAltKey],101) as [datetime] ,[BudgetTarget] as [money]&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;FROM [PeanutsY].[dbo].[DimBudget]&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;ORDER BY [TimeAltKey] &lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;OPEN test_cursor&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;FETCH NEXT FROM test_cursor&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;INTO @date, @datetime, @money&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;WHILE @@FETCH_STATUS = 0&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;BEGIN&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;INSERT INTO TestDB.dbo.test VALUES (@date,@datetime,@money)&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;FETCH NEXT FROM test_cursor&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;INTO @date, @datetime, @money&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;END&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;CLOSE test_cursor&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;DEALLOCATE test_cursor&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;Then I create a brand new PBIX, connect it directly to the new database, load the table, edit the 'date' and 'datetime' column using locale (American English), and create my measures:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;&lt;img /&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am the DBA, as well as the BI Admin, the storage admin, the server admin and whatever else admin role exists; I do everything. There is no one for me to talk to but myself, and&amp;nbsp;if I did heads would explode :D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: I assumed the last reply was from Dale, but I see now that it was from Herbert.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 06:09:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/199037#M87568</guid>
      <dc:creator>apollnor</dc:creator>
      <dc:date>2017-06-22T06:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/201252#M88524</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13401" data-lia-user-login="apollnor" class="lia-mention lia-mention-user"&gt;apollnor&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We still work on it. Thanks for your patience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards!&lt;/P&gt;&lt;P&gt;Dale&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 12:18:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/201252#M88524</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2017-06-26T12:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/206879#M91144</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13401" data-lia-user-login="apollnor" class="lia-mention lia-mention-user"&gt;apollnor&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The fix will be available in August 2017 version of Power BI Desktop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Herbert&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 01:45:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/206879#M91144</guid>
      <dc:creator>v-haibl-msft</dc:creator>
      <dc:date>2017-07-06T01:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/217295#M96240</link>
      <description>&lt;P&gt;Thanks guys :)&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 06:13:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/217295#M96240</guid>
      <dc:creator>apollnor</dc:creator>
      <dc:date>2017-07-24T06:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/233239#M103886</link>
      <description>&lt;P&gt;I still have this issue with a time slice and I'm on Version: 2.49.4831.521 64-bit (August 2017) ???&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 12:44:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/233239#M103886</guid>
      <dc:creator>cxtale</dc:creator>
      <dc:date>2017-08-17T12:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with DAX, SQL and locale</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/235048#M104623</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39403" data-lia-user-login="cxtale" class="lia-mention lia-mention-user"&gt;cxtale&lt;/a&gt;: That's strange, after the update (i just downloaded it as i read what you wrote), this seems to have been fixed for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Version: 2.49.4831.521 64-bit (august 2017)&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 08:55:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Problems-with-DAX-SQL-and-locale/m-p/235048#M104623</guid>
      <dc:creator>apollnor</dc:creator>
      <dc:date>2017-08-21T08:55:37Z</dc:date>
    </item>
  </channel>
</rss>

