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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
JihyeHeo
Frequent Visitor

DAX: To sum negative and positive numbers in a column

Hello, I need to sum the negative and positive numbers in a column.

For example, some orders used to be cancled after it is entered. I use sumx function but the it considers the negative values as the positive ones. Please help!

image.png

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @JihyeHeo 

what is your desired output?

if you need only sum of positive or only negative values try calculations like

CALCULATE(SUM([Sales Value]), [Sales Value]>0)

or 

CALCULATE(SUM([Sales Value]), [Sales Value]<0)​

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

It would really help if you could phrase your problem/question in a more understandable and detailed way. For the time being it's not possible to understand what the issue is and what you want to calculate.

Thanks.

Best
D
Anonymous
Not applicable

Normal sum should have work.

 

Measure=sum(table[Amount])

 

Drag order number and measure in table visual.

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

az38
Community Champion
Community Champion

Hi @JihyeHeo 

what is your desired output?

if you need only sum of positive or only negative values try calculations like

CALCULATE(SUM([Sales Value]), [Sales Value]>0)

or 

CALCULATE(SUM([Sales Value]), [Sales Value]<0)​

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.