Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I am adding a custom column with the following syntax
=Table.AddColumn(PrevStep,"One", each 1, Int8.Type)
The column is added, but in the column header I can see that it has been typed as a Decimal Number.
Any idea why?
(I can change this manually in the next step, but I'm interested to know if I'm doing something wrong.)
Thanks.
Solved! Go to Solution.
Sorry about that! LOL! I've added the intended link below.
https://docs.microsoft.com/en-us/powerquery-m/power-query-m-type-system
You are correct, the type names don't necessarily align to the actual types. Below is a quote from https://bengribaudo.com/blog/2020/02/28/5009/power-query-m-primer-part17-type-system-ii-facets
Instead, these “Type” names are simply names associated with expressions that return the appropriate type to use for whatever the name describes, decorated with the applicable type claim facet. For example, Int8.Type is a name associated with an expression that returns a type value of the correct type to use for 8-bit integers (type number) decorated with a type claim facet of “Int8.Type”
If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.
Proud to be a Microsoft Fabric Super User
Sorry about that! LOL! I've added the intended link below.
https://docs.microsoft.com/en-us/powerquery-m/power-query-m-type-system
You are correct, the type names don't necessarily align to the actual types. Below is a quote from https://bengribaudo.com/blog/2020/02/28/5009/power-query-m-primer-part17-type-system-ii-facets
Instead, these “Type” names are simply names associated with expressions that return the appropriate type to use for whatever the name describes, decorated with the applicable type claim facet. For example, Int8.Type is a name associated with an expression that returns a type value of the correct type to use for 8-bit integers (type number) decorated with a type claim facet of “Int8.Type”
If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.
Proud to be a Microsoft Fabric Super User
Thank you for your answer, but do you know if it's usefull for the performance to store as 8bit type instead of the default 64 ?
Hello - it is due to the type being specified as Int8.Type and how Power Query handles numeric types. If you change it to Int64.Type you will see it as a whole number. I have included some links below if you would like to read more about the type system.
https://bengribaudo.com/blog/2020/02/28/5009/power-query-m-primer-part17-type-system-ii-facets
If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.
Proud to be a Microsoft Fabric Super User
Hi Jen. The first link you sent is to my question 😉 I skimmed over the second link, but it still seems curious that it doesn't recognise Int8, Int16, Int32 as integers, although it perhaps does....is it just the icon on the column header that is misleading?