cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Regular Visitor

## How to convert negative numbers into positive numbers

Hi all,

As the subject suggests; How can I convert negative numbers into positive numbers?

Thanks

5 REPLIES 5

Calculate column, from negative to positive and keep positive as positive.

= each if [COLUMN] < 0 then [COLUMN] *-1 else [COLUMN] *1)

Impactful Individual

Thank you for your solution! I'd also add that it also works for measures.

You could also highlight the column in the query editor and right click, select transform, and choose absolute value. That would give the positve number outcome you're looking for.

Super User

@Len - You might have to wrap it in an IF statement if you want to preserve already positive numbers.

You could also use the ABS function (absolute value)

You cold also multiple by -1, "[Column] * -1"

With ABS you could get rid of negative numbers while not impacting the positive numbers.

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Community Champion

Just put a "-" or a "0 -" in front. A double negative is a positive.

For instance, I have a measure that calculates lost opportunities, intended to be used on a column chart along with a net gain measure. What I want is for the loss to be a descending column below the 0 line, and the gain to be a positive column above. The basic calculation of each is a sum, so they normally both return a positive number. So my formula instead is:

Lost Opportunity = 0 - CALCULATE(

SUM(Items[Forecast Amount]) - SUM(Items[Actual]),

FILTER(

Items,

Items[Status] = "Cancelled"

)

)

Elsewhere I have another measure that requires the positive number version of Lost Opportunity, so:

% Lost = DIVIDE(-[Lost Opportunity], [Total Gain])

Lost Opportunity already returns a negative number, so -[Lost Opportunity] converts it back.

Proud to be a Super User!

Announcements

#### Power BI Monthly Update - November 2023

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

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors