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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Adding up only negative values

Hi All,

I am trying to add up a column by only adding up the negative numbers and if there are positive numbers, just setting those to 0 so they don't affect the final total.  Here is some sample data:

 

sampdata1.PNG

As you can see - the total is -311 whereas if the positive values in here were excluded, the total would be around -850 or so.  I believe it needs to something to say If Sales >0, then 0, otherwise sum up the column but i'm unsure as how to put it together.  Any help would be appreciated.

 

Thanks!

 

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try this column:

Column = IF('Table'[Sales]>0,0,'Table'[Sales])

The result shows:

33.PNG

 

Best Regards,

Giotto Zhi

 

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Hello everyone

How can you add only positive values of a measure?

I've been trying to figure this out for days.

Rodrigo P

v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try this column:

Column = IF('Table'[Sales]>0,0,'Table'[Sales])

The result shows:

33.PNG

 

Best Regards,

Giotto Zhi

 

Tahreem24
Super User
Super User

@Anonymous ,

 

Create below DAX measure:

Measure  = CALCULATE(SUM(Table[Sales]),Table[Sales]<0)
 
Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
amitchandak
Super User
Super User

Try like

sumx(Table,if(table[sales]<0,table[sales],0))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors