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

View all the Fabric Data Days sessions on demand. View schedule

Reply
maflingo
Regular Visitor

Subtracting two decimal numbers gives 100x the value

Hi,

I have an issue where I'm creating a new column in M by subtracting two columns containgin decimal values. However, when the numbers have decimals other than ,00 it returns 100x the value, so for instance 652,96-676 becomes -2304 instead of -23,04. I've tried converting the columns to decimals a few different ways, but the error persists. This is the relevant snippet in M, would be grateful if anyone has an idea, thanks!

 

   #"Changed to num" = Table.TransformColumnTypes(
    #"Expanded FactValue (2)", 
    {{"cdmValue", type number}, {"FactValue (2).cdmValue", type number}} ),
    
    // Takes the difference between this and previous month's values if 01, 02, 08 or 12, else the value
    #"Added Value-col" = Table.AddColumn(#"Changed to num", "ValueMonthly",
            each if Text.Contains([idMetric], "IF01") 
             or Text.Contains([idMetric], "IF02") 
             or Text.Contains([idMetric], "IF10") 
             or Text.Contains([idMetric], "IF12") 
            then 
                if [#"FactValue (2).cdmValue"] <> null 
                then [cdmValue] - [#"FactValue (2).cdmValue"]
                else [cdmValue]
            else [cdmValue]
            ),

    #"ValueMonthly to num" = Table.TransformColumnTypes(#"Added Value-col",{{"ValueMonthly", type number}})

 

 

1 ACCEPTED SOLUTION

Thank you both for the suggested solutions. The issue was fixed somehow while I was fixing something else. No idea what it was in the end..

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I would specify Currency.Type instead of type number.

 

--Nate

dufoq3
Super User
Super User

Hi @maflingo, in my opinion the issue is with locale. Try to use ChangedType step with locale

 

dufoq3_0-1723720209009.png

let
    Source = Table.FromList({{652.76, 676}}, (x)=> x),
    ChangedTypeGB = Table.TransformColumnTypes(Source,{{"Column1", type number}}, "en-GB"),
    #"Added Custom" = Table.AddColumn(ChangedTypeGB, "Custom", each [Column1] - [Column2])
in
    #"Added Custom"

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Thank you both for the suggested solutions. The issue was fixed somehow while I was fixing something else. No idea what it was in the end..

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.