Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

query folding and change of column data type

Hello,

 

I need to concatenate numeric columns in my table using Add.Column, like:

 

= Table.AddColumn(Custom1, "UniqueID", each (Text.From([CaseID])&Text.From([SolutionID])), Int64.Type)

 

I thought using the "Int64.Type" at the end of the step should format the new column as whole number automatically, however it seems that they are just recognized as text. When I then manually convert the column to "whole number" query folding doesn't happen anymore. Is there an error on my side or a workaround to ahve query folding happen even after a column data type is changed?

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

if I understand the language specification correctly Type.Int64 is just an extension of type number. See here:

https://docs.microsoft.com/en-us/powerquery-m/power-query-m-language-specification, (see page 46):

The M type system consists of the following kinds of types:
• Primitive types, which classify primitive values (binary, date, datetime,
datetimezone, duration, list, logical, null, number, record, text, time, type)
and also include a number of abstract types (function, table, any, and none)

I would try using 'type number' instead of Type.Int64, hopefully it works (it may be limitation of Direct Query though, which I assume you are using, since you mentioned folding).. You can then change format in DAX separately from the type



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

4 REPLIES 4
Brunner_BI
Super User
Super User

There are some changes to data types that allow and some that will break query-folding.

 

I actually wrote a blog post about this (valid for SQL Server 2016)

 

https://www.brunner.bi/post/changing-data-types-that-do-not-break-query-folding-in-power-query-power...

Stachu
Community Champion
Community Champion

if I understand the language specification correctly Type.Int64 is just an extension of type number. See here:

https://docs.microsoft.com/en-us/powerquery-m/power-query-m-language-specification, (see page 46):

The M type system consists of the following kinds of types:
• Primitive types, which classify primitive values (binary, date, datetime,
datetimezone, duration, list, logical, null, number, record, text, time, type)
and also include a number of abstract types (function, table, any, and none)

I would try using 'type number' instead of Type.Int64, hopefully it works (it may be limitation of Direct Query though, which I assume you are using, since you mentioned folding).. You can then change format in DAX separately from the type



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

You've just helped my query folding go from red to blue in the dataflow window

Anonymous
Not applicable

Thanks, luckily that was an easy fix for my issue!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors