Forum Discussion
mklevemann
7 months agoFrequent Visitor
Rounding issue with DataFlow Gen2
I am loading a fabric data warehouse using Dataflow Gen2 and have run into a weird problem. Whenever I do any floating point math with a couple of columns of the data I'm uploading, I get a good flo...
- 7 months ago
Hello mklevemann
This usually happens when the destination column (in your Fabric Data Warehouse) is defined with no scale, e.g., DECIMAL(38) which defaults to DECIMAL(38,0). In T‑SQL, if you omit the scale, SQL rounds/truncates the fractional part on insert. Dataflow Gen2 shows the correct floating‑point value in the preview, but when it lands in the warehouse it’s implicitly cast to DECIMAL(38,0), so the decimals are lost.Alter the Warehouse column to include scalePick a scale that fits your business rules (common choices: 2 for money, 4 or more for rates, 6–12 for scientific/FX).-- Example: keep up to 10 decimal placesALTER TABLE dbo.YourTableALTER COLUMN YourNumericColumn DECIMAL(38, 10) NOT NULL; -- or NULL if applicableHope this helps - please appreciate giving a Kudos or accepting as a Solution!
deborshi_nag
7 months agoSuper User
Hello mklevemann
This usually happens when the destination column (in your Fabric Data Warehouse) is defined with no scale, e.g., DECIMAL(38) which defaults to DECIMAL(38,0). In T‑SQL, if you omit the scale, SQL rounds/truncates the fractional part on insert. Dataflow Gen2 shows the correct floating‑point value in the preview, but when it lands in the warehouse it’s implicitly cast to DECIMAL(38,0), so the decimals are lost.
Alter the Warehouse column to include scale
Pick a scale that fits your business rules (common choices: 2 for money, 4 or more for rates, 6–12 for scientific/FX).
-- Example: keep up to 10 decimal places
ALTER TABLE dbo.YourTable
ALTER COLUMN YourNumericColumn DECIMAL(38, 10) NOT NULL; -- or NULL if applicable
Hope this helps - please appreciate giving a Kudos or accepting as a Solution!
mklevemann
7 months agoFrequent Visitor
Thanks! My brain must not have been working properly that day. Your solution worked perfectly.