cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dowsey1977
New Member

Turn Negative Numbers into Positive

Hi,

 

I have a column in a table called Account_Balances that I want to sum into table on a report.  I have used the below to acheive this:

CALCULATE((SUM(Report1[ACCOUNT_BALANCE])),Report1[ACCOUNT_BALANCE]<0)

 

However, because the source data is negative where the account balance is in credit, the total number is also a negative number.  I am trying to turn that into a positive number on the report, but failing miserably.

 

Here is what I have tried so far:

1. Created a measure on source table with ABS(ACCOUNT_BALANCE).  Then used the below formula:

CALCULATE(SUM(Report1[ABSBalance]),FILTER(ALL(Report1),Report1[ACCOUNT_BALANCE]<0))
2. Tried inserting ABS( ... ) in various places within my original formula
 
Whatever I have tried, the table on the report just goes blank.  Any ideas what I am doing wrong?
 
TIA,
Dowsey
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

Positive balance =
ABS (
    CALCULATE ( ( SUM ( Report1[ACCOUNT_BALANCE] ) ), Report1[ACCOUNT_BALANCE] < 0 )
)

View solution in original post

2 REPLIES 2
Dowsey1977
New Member

Excellent - many thanks...I knew it would be a simple solution, I'm just a newbie to Power BI.

johnt75
Super User
Super User

Try

Positive balance =
ABS (
    CALCULATE ( ( SUM ( Report1[ACCOUNT_BALANCE] ) ), Report1[ACCOUNT_BALANCE] < 0 )
)

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.