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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How do you show negative number in matrix without subtracting from the total

@ links to members, content

Hello, I am not sure how to write DAX for my calculation needed in a matrix.  I am showing figures within a group some of the figures are negative numbers.  It appears the matrix will add all the numbers and then subtract the negative value from the total.  This is not what I want.  I want to show the negative value but I do not want the negative value to be subtracted from the positive values. 

Here is my sample 

Fund TypeSegment Donor FlowYearSum of DonorsColumn1     The total comes out as 20465 which is not correct.  The matrix is totaling all positive numbers and then subtracting the negative number in red.  I would also like to highlight the negative numbers in red in the matrix.                     

26582 This is the correct total I want to see in the Matrix

GeneralHoustonKeep20217877 
GeneralHoustonLess20213927 
GeneralHoustonLift20216773 
GeneralHoustonLost2021-6117 
GeneralHoustonWin20215662 
GeneralHoustonWin-Back20212343 
1 ACCEPTED SOLUTION

Hi,

These measures work

D = sum(Data[Donors])
Measure = if(ISINSCOPE(Data[Year]),[D],SUMX(FILTER(Data,[D]>0),[D]))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Sample Data

 

Fund        Segment   Flow         Year      Donor

General    Houston    Keep        2021      7877

General    Houston    Less          2021      3927

General    Houston    Lift            2021      6773

General    Houston    Loss          2021     -6117

General    Houston    Win           2021      5662

General    Houston   Win-back   2021       2343

Total                                                         20465 Wrong Total 

 

Correct Total should be 26,582

Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with (in a format that can be pasted in an MS Excel file).  At the very least, ensure that the columns have proper headings.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hello, I am not sure how to write DAX for my calculation needed in a matrix.  I am showing figures within a group some of the figures are negative numbers.  It appears the matrix will add all the numbers and then subtract the negative value from the total.  This is not what I want.  I want to show the negative value but I do not want the negative value to be subtracted from the positive values. 

Here is my sample 

Fund TypeSegment Donor FlowYearSum of DonorsColumn1     The total comes out as 20465 which is not correct.  The matrix is totaling all positive numbers and then subtracting the negative number in red.  I would also like to highlight the negative numbers in red in the matrix.     

 

Sample Data

 

Fund        Segment   Flow         Year      Donor

General    Houston    Keep        2021      7877

General    Houston    Less          2021      3927

General    Houston    Lift            2021      6773

General    Houston    Loss          2021     -6117

General    Houston    Win           2021      5662

General    Houston   Win-back   2021       2343

Total                                                         20465 Wrong Total 

 

Correct Total should be 26,582

Hi,

These measures work

D = sum(Data[Donors])
Measure = if(ISINSCOPE(Data[Year]),[D],SUMX(FILTER(Data,[D]>0),[D]))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Ashish, 

The measure works, however, it removes by negative number.  I would like for my negative number to show in the matrix. 

Anonymous
Not applicable

Ashish, 

Thank you for your assistance.  I got it to work by changing the Year filter to Donor Flow.  

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

 

Sample Data

Fund        Segment  Flow          Year    Donors

GeneralHoustonKeep20217877 
GeneralHoustonLess20213927 
GeneralHoustonLift20216773 
GeneralHoustonLost2021-6117 
GeneralHoustonWin20215662 
GeneralHoustonWin-Back20212343 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors