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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
SAGUILAR
Frequent Visitor

Sum only positive

Hello,

 

I'm triying to show the total of the positive values only from a measure (Inv. Expected) that I created that substracts and sums several columns.

In this scenario, the total includes the -58.56. I don't want to consider that value, I need to show the result of the sum of all the positives.

SAGUILAR_1-1722521239238.png

Thanks!!!

 

2 ACCEPTED SOLUTIONS
collinq
Super User
Super User

Hey @SAGUILAR ,

 

I think that formula in Dax would be something like "CALCULATE(SUM('Table'[field],'Table'[field] >0)"

Let us know if that works to do what you want.




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




View solution in original post

Anonymous
Not applicable

Thank you @collinq 

Hi, @SAGUILAR 

Based on your description, I created a simple dataset:

vjianpengmsft_0-1722572534806.png

You mentioned that the column you are currently showing is a metric, so I simply created a measure as follows:

vjianpengmsft_1-1722572646505.png

In order to sum only the positive values in total, I created a measure using the following DAX expression while keeping the original measure:

MEASURE =
IF (
    ISINSCOPE ( 'Table'[Id] ),
    'Table'[Amounts],
    SUMX ( FILTER ( 'Table', 'Table'[Amounts] >= 0 ), 'Table'[Amounts] )
)

Here are the results:

vjianpengmsft_2-1722572843965.png

I've uploaded the PBIX file I used this time below.

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you @collinq 

Hi, @SAGUILAR 

Based on your description, I created a simple dataset:

vjianpengmsft_0-1722572534806.png

You mentioned that the column you are currently showing is a metric, so I simply created a measure as follows:

vjianpengmsft_1-1722572646505.png

In order to sum only the positive values in total, I created a measure using the following DAX expression while keeping the original measure:

MEASURE =
IF (
    ISINSCOPE ( 'Table'[Id] ),
    'Table'[Amounts],
    SUMX ( FILTER ( 'Table', 'Table'[Amounts] >= 0 ), 'Table'[Amounts] )
)

Here are the results:

vjianpengmsft_2-1722572843965.png

I've uploaded the PBIX file I used this time below.

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

collinq
Super User
Super User

Hey @SAGUILAR ,

 

I think that formula in Dax would be something like "CALCULATE(SUM('Table'[field],'Table'[field] >0)"

Let us know if that works to do what you want.




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.