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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
vivek_rana
Frequent Visitor

How to sum Negative and Positive numbers in power BI for a Measure

I have 2 columns , sales and Profit with postive and negative values for both..     I need to create a measure in power bi Desktop to find the difference (Sales - Profit)....      Our difference will contain negative and postive numbers...   Now my query is how to consider the negative numbers as positive and sum them up with postive numbers.. Please find the attached screeshots. Please note difference  is not a column , its  a measure to be calculated in power bi. i am not able to attach excel .hopefully someone can help me in the community.. Thanks

 

Wrong Output.PNGDesired output.PNG

1 ACCEPTED SOLUTION
samdthompson
Memorable Member
Memorable Member

I think @AlexisOlson it needs one more step to get the rows responding the same way as presented:

 

2021-08-11_10-21-02.jpg

// if this is a solution please mark as such. Kudos always appreciated.

View solution in original post

3 REPLIES 3
samdthompson
Memorable Member
Memorable Member

I think @AlexisOlson it needs one more step to get the rows responding the same way as presented:

 

2021-08-11_10-21-02.jpg

// if this is a solution please mark as such. Kudos always appreciated.

Thankyou so much...Thompson  🙂

AlexisOlson
Super User
Super User

Do you need your difference measure to preserve the sign at the individual product level or can you do this?

AbsDiff = SUMX ( VALUES ( Table1[Product] ), ABS ( [Sales] - [Profit] ) )

Where [Sales] and [Profit] are appropriately defined measures, e.g. Sales = SUM ( Table1[Sales] ).

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors