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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
joshua1990
Post Prodigy
Post Prodigy

SUM if second column is 0

Hi experts!

I have a table/ Matrix that shows me 2 value columns per article

ArticleValue 1Value 2Final Value
A502500
B05252
C06363
D5000

 

Now I would like to create a measure "Final Value" that displays a value if Value 1 is 0.

But how? I need probably a SUMX, right?

 

 

 

7 REPLIES 7
v-jianboli-msft
Community Support
Community Support

Hi @joshua1990 ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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

v-jianboli-msft
Community Support
Community Support

Hi @joshua1990 ,

 

Please try:

 

Final Value = SUMX('Table',IF([Value 1]=0,[Value 2],0))

 

 

Output:

vjianbolimsft_0-1658225036749.png

 

Best Regards,

Jianbo Li

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

tamerj1
Super User
Super User

Hi @joshua1990 
Not sure if this is what you're looking for. However please refer to below method using one measure and utilizing the column subtotals

 

1.png

Values = 
VAR CurrentValue = SUM ( Sheet1[Value] )
VAR Value1 = CALCULATE ( SUM ( Sheet1[Value] ), Sheet1[Attribute] = "Value 1" )
VAR Result =
    IF (
        HASONEVALUE ( Sheet1[Attribute] ),
        CurrentValue,
        IF ( 
            Value1 = 0,
            CurrentValue,
            0
        )
    )
RETURN
    Result
joshua1990
Post Prodigy
Post Prodigy

ArticleValue 1Value 2Final Value
A502500
B05252
C06363
D5000
Total100365115

 

Please see Final Value as expected result @technolog 

technolog
Super User
Super User

Do you mean measure or calculated column?

You can create calculated column:

calc col = IF([Value 1] = 0, "Value 1 equal zero", BLANK())

Or you can try to use measure:

measure = IF(SUM([Value 1]) = 0, "Value 1 equal zero", BLANK())

@technolog : Thanks, I want a measure in the end. Your approach is not working. I want a value in the end with the correct Grand and Sub Total. I would assume I need a SUMX

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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