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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
philtab
Frequent Visitor

Sum negative values for groups

Hi all,

 

I have somehow a tricky problem.

I want to create a measure which sums the negative values per Company and Account:

 

CompanyAccountValue
AK10010
AK100-10
AK20020
BK10020
BK100-30
BK200-40
CK10010
CK20020
CK200-30

 

So for the table above I would like to get the result of -60:

 

> -10 for Company B and Account K100

> -40 for Company B and Account K200

> -10 for Company C and Account K200

 

I am only able to sum all negative values with the result of -110....

 

Any chance that I can group within the measure by Company and Account?

 

Any help would be much appreciated.

 

Many thanks

Philip

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@philtab

 

 

Hi, please try with this measure:

 

SumNegatives =
SUMX (
    SUMMARIZE (
        Table1,
        Table1[Company],
        Table1[Account],
        "SumValues", CALCULATE ( SUM ( Table1[Value] ) )
    ),
    IF ( [SumValues] < 0, [SumValues], 0 )
)

Regards

 

Victor

Lima - Peru




Lima - Peru

View solution in original post

2 REPLIES 2
Vvelarde
Community Champion
Community Champion

@philtab

 

 

Hi, please try with this measure:

 

SumNegatives =
SUMX (
    SUMMARIZE (
        Table1,
        Table1[Company],
        Table1[Account],
        "SumValues", CALCULATE ( SUM ( Table1[Value] ) )
    ),
    IF ( [SumValues] < 0, [SumValues], 0 )
)

Regards

 

Victor

Lima - Peru




Lima - Peru

Victor,

many thanks! You saved my day, thats it!

 

Best

Philip

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.