Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Change date type without losing native query

Hi there,


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. 

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? 


I don't want to change the date type already in the SQL database (because of multiple databases with several languages).

Any kind of help is appreciated. Thanks!



Community Support
Community Support

Hi @Gertjan ,


In Power Query, Text -> all transformations would break query-folding.

Changing data types that do not break query-folding in Power Query / Power BI 


Please try using sql statement in query.


    Source = Sql.Database(".", "CaseTest", [Query="select #(lf)    CAST( [Date2] AS date) [Date],#(lf)    [Value] as [Rename_Value]#(lf)from [dbo].[Test1$]"])



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.
Best Regards,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your suggestion. However, it still doesn't allow me to view native query.


Maybe it's just not possible?

Super User
Super User

That is surprising, my friend.  Did you happen to re-click the steps from beginning to end, to make sure that the View Native Query doesn't light up?  Or perhaps clear the cache?


Oh yeah, you could try Date.FromText, or even just the Parse Date GUI function.



I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

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?

Super User
Super User

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.



I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

Thanks @watkinnc, the query itself works, however it still doesn't allow to view native query. Any other solution?





Helpful resources

November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors