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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MS3
Frequent Visitor

SUM value is Row in a Column Equals a Specific Value and Value is Greater than Zero

 

Hello!

 

I am trying to SUM Values [Amount] if a Column [FS Item (Account)] is Equal to a Specific Value [173] and the [Amount] is Positive / Greater than Zero.

 

The formula I have to SUM the values is

CALCULATE (
    SUM ( Masterdata[Amount] ),
    Masterdata[FS Item (Account)]="173"
)
 
which provides the SUM, but I am unsure how to add the condition for it to add only the [Amount] that are greater than zero.
 
Would appreciate any help.
 
Best regards,

 

1 ACCEPTED SOLUTION
Pragati11
Super User
Super User

Hi @MS3 ,

 

Try the following DAX:

 

CALCULATE (
                     SUM ( Masterdata[Amount] ),
                     FILTER(
                                 Masterdata, Masterdata[FS Item (Account)]="173" && Masterdata[Amount] > 0
                                )
)
 
Kindly give Kudos if the solution is helpful and Mark it as a solution if it resolves the issue! 🙂
 
Thanks,
Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

5 REPLIES 5
Pragati11
Super User
Super User

Hi @MS3 ,

 

Try the following DAX:

 

CALCULATE (
                     SUM ( Masterdata[Amount] ),
                     FILTER(
                                 Masterdata, Masterdata[FS Item (Account)]="173" && Masterdata[Amount] > 0
                                )
)
 
Kindly give Kudos if the solution is helpful and Mark it as a solution if it resolves the issue! 🙂
 
Thanks,
Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

MS3
Frequent Visitor

 

Thank you very much!!!

 

It worked wonderfully!

Anonymous
Not applicable

it should be like this 
CALCULATE (
    SUM ( Masterdata[Amount] ),
    Masterdata[FS Item (Account)]="173"
    && [Amount] >0
)
MS3
Frequent Visitor

 

Needed to add the table for Amount as per below:

 

CALCULATE (    SUM ( Masterdata[Amount] ),
    Masterdata[FS Item (Account)]="173"
    && Masterdata [Amount] >0
)

 

When I use the expression it tells me

"The expression contains multiple columns, but only a single column can be used in a True / False expression that is used as a Table Filter Expression"

 

Indeed [Amount] and [FS Item (Account)]] are columns in my Masterdata table.

 

 

Anonymous
Not applicable

sry, my bad 
do like this with a filter function :

scr.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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