<?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: Change date type without losing native query in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/3544586#M115995</link>
    <description>&lt;P&gt;Not sure if you still searching for a fix, however this is how i did it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use this in the SQL statement " CONVERT(DATE,&lt;U&gt; t.[SHIPDATE]&lt;/U&gt;, 103) AS '&lt;U&gt;Shipment Date&lt;/U&gt;'&amp;nbsp; " (use your column names )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will automatically recognise the column as Date/Time&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;And you do not need the "Changed Type" step that blocks the Native Query:&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;And after that, just change the format to "Short Date" from the "Table View"&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And you can use the column in a relashionship with another table.&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;And because you are not breaking the Native Query, you can use the "Incremental Refresh" as well without the warning of not being able to fold.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Nov 2023 11:49:02 GMT</pubDate>
    <dc:creator>AlexCod</dc:creator>
    <dc:date>2023-11-21T11:49:02Z</dc:date>
    <item>
      <title>Change date type without losing native query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2589466#M78932</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with two columns: item and date. There are four applied steps in the Power Query: Source, Navigation, Renamed Columns and Changed Type.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date is initially formatted as text, but I want it to be a date, so that's what the Changed Type step is all about. However, I lose native query after adding this step. Is there a way to avoid this, so that it will still be possible to view native query?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't want to change the date type already in the SQL database (because of multiple databases with several languages).&lt;BR /&gt;&lt;BR /&gt;Any kind of help is appreciated. Thanks!&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 11:46:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2589466#M78932</guid>
      <dc:creator>Gertjan</dc:creator>
      <dc:date>2022-06-20T11:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Change date type without losing native query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2589512#M78935</link>
      <description>&lt;P&gt;Instead of Table.TransformColumnTypes, go back and make it Table.TransformColumns, and replace "type date" with "Date.From". Basically using Date.From to transform instead of changing types.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Nate&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 12:02:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2589512#M78935</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-20T12:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Change date type without losing native query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2589802#M78945</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;Anonymous&lt;/LI-USER&gt;, the query itself works, however it still doesn't allow to view native query. Any other solution?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;</description>
      <pubDate>Mon, 20 Jun 2022 13:47:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2589802#M78945</guid>
      <dc:creator>Gertjan</dc:creator>
      <dc:date>2022-06-20T13:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Change date type without losing native query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2589959#M78950</link>
      <description>&lt;P&gt;That is surprising, my friend.&amp;nbsp; Did you happen to re-click the steps from beginning to end, to make&amp;nbsp;&lt;EM&gt;sure&amp;nbsp;&lt;/EM&gt;that the View Native Query doesn't light up?&amp;nbsp; Or perhaps clear the cache?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh yeah, you could try Date.FromText, or even just the Parse Date GUI function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Nate&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 14:43:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2589959#M78950</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-20T14:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Change date type without losing native query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2591278#M79001</link>
      <description>&lt;P&gt;I re-clicked the steps, cleared the cache and tried the other functions. However, View Native Query still doesn't light up. Any other ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 06:51:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2591278#M79001</guid>
      <dc:creator>Gertjan</dc:creator>
      <dc:date>2022-06-21T06:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Change date type without losing native query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2596591#M79220</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="295216" data-lia-user-login="Gertjan" class="lia-mention lia-mention-user"&gt;Gertjan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Power Query, Text -&amp;gt; all transformations would break query-folding.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://en.brunner.bi/post/changing-data-types-that-do-not-break-query-folding-in-power-query-power-bi-1" target="_self"&gt;Changing data types that do not break query-folding in Power Query / Power BI&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try using sql statement in query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Sql.Database(".", "CaseTest", [Query="select #(lf)    CAST( [Date2] AS date) [Date],#(lf)    [Value] as [Rename_Value]#(lf)from [dbo].[Test1$]"])
in
    Source&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.&lt;BR /&gt;Best Regards,&lt;BR /&gt;Winniz&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 06:47:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2596591#M79220</guid>
      <dc:creator>v-kkf-msft</dc:creator>
      <dc:date>2022-06-23T06:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Change date type without losing native query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2596922#M79231</link>
      <description>&lt;P&gt;Thanks for your suggestion. However, it still doesn't allow me to view native query.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Maybe it's just not possible?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 08:14:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/2596922#M79231</guid>
      <dc:creator>Gertjan</dc:creator>
      <dc:date>2022-06-23T08:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Change date type without losing native query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/3544586#M115995</link>
      <description>&lt;P&gt;Not sure if you still searching for a fix, however this is how i did it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use this in the SQL statement " CONVERT(DATE,&lt;U&gt; t.[SHIPDATE]&lt;/U&gt;, 103) AS '&lt;U&gt;Shipment Date&lt;/U&gt;'&amp;nbsp; " (use your column names )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will automatically recognise the column as Date/Time&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;And you do not need the "Changed Type" step that blocks the Native Query:&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;And after that, just change the format to "Short Date" from the "Table View"&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And you can use the column in a relashionship with another table.&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;And because you are not breaking the Native Query, you can use the "Incremental Refresh" as well without the warning of not being able to fold.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 11:49:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Change-date-type-without-losing-native-query/m-p/3544586#M115995</guid>
      <dc:creator>AlexCod</dc:creator>
      <dc:date>2023-11-21T11:49:02Z</dc:date>
    </item>
  </channel>
</rss>

