Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
In Power Query, I encountered an issue where I had a column formatted as Whole Number. There were Null values in the column, so I added a step to replace Null with zero. After that step, somehow Power Query automatically/incorrectly changed the format of the column to Decimal Number. There is no line in the m code changing the format to decimal. Another step later in the process was expecting this column to be whole number, so I was getting a “we couldn’t convert to Number” error.
M Code:
#"Changed Type9" = Table.TransformColumnTypes(#"Sort By Date Value Then Employee ID",{{"Hire Count", Int64.Type}}), // Changed the column to Whole Number
#"Replaced Value1" = Table.ReplaceValue(#"Changed Type9",null,0,Replacer.ReplaceValue,{"Hire Count"}), // Replaced Null with Zero
#"Changed Type10" = Table.TransformColumnTypes(#"Replaced Value1",{{"Hire Count", Int64.Type}}), // Had to change the format back to Whole Number even though there is no step here that changed it to Decimal Number
This is my first post, so my apologies if I posted this to the wrong section.
Thanks, Ryan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.