Forum Discussion
frano72
4 years agoHelper IV
PQ int64 type conversion - explicit versus in Add.Column statement - different results (bug ?)
Hi,
You can perform a type conversion within an Add.Column statement without having to do a second step after.
Looks like this :
Table.AddColumn(#"Changed to Date", "ShiftIndex", each Text.Combine({Date.ToText([Day], "yyyy"), Date.ToText([Day], "MM"), Date.ToText([Day], "dd"), Text.From([Shift_ID], "en-AU")}), Int64.Type)
In the datflows UX you can see in first image below that it looks like a success.
However when refreshing the dataflow it gave a type conversion error.
I then added an additional step to convert the column to Int64 and the refresh worked.
If you look closely at the two images, you can see how the numbers are formatted differently (alignment and italics), however the type indicator at the top of the column shows the 123 logo.
Weird....
Hi frano72 ,
my friend Lars Schreiber has a good explanation why this happens and how to avoid here: Ascribed types in M: why to generally avoid them (ssbi-blog.de)
2 Replies
- ImkeFCommunity Champion
Hi frano72 ,
my friend Lars Schreiber has a good explanation why this happens and how to avoid here: Ascribed types in M: why to generally avoid them (ssbi-blog.de)