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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
VivianaTudora
Frequent Visitor

Change positives to negatives and the other way around

Hi all, 

 

I have a column with both negative and positive values and I need to have them changed to the opposite. The positives are actually negative and negatives are positive. I know I can change them all to absolute, but can't think how to also store the positives as negative?

Hope this makes sense, no idea why the values are stored like this in the database. 

 

Thank you!

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

3 REPLIES 3
Anonymous
Not applicable

I don't like creating a new custom column to multiply the old value by -1, so I solved the problem by transforming the value in place using a trivial custom function "Negate"

 

let
    Negate = ( x ) => try -1 * x otherwise null,

    Source = Table.FromRecords({
        [CustomerID = 1, Name = "Bob",  Value = 305 ],
        [CustomerID = 2, Name = "Jim",  Value = -100 ],
        [CustomerID = 3, Name = "Paul", Value = 0.305 ],
        [CustomerID = 4, Name = "Pau2", Value = "0.305" ],
        [CustomerID = 5, Name = "Pau3", Value = null ]
    }),

    Negated = Table.TransformColumns(Source, {{"Value", Negate}})

in
    Negated
Zubair_Muhammad
Community Champion
Community Champion

@VivianaTudora

 

You can simply multiply them with -1.

Isn't it?

You're right! Didn't realise it's so simple. 

Thanks a lot! 🙂

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.