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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Sdhn420
Helper IV
Helper IV

Total of positive and negatives

Hi,

 

How can I show total of all negative and positive values?

I have a measure [Loss_of_Margin]

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Sdhn420 , for that you need a group by context

example

 

+ive =

sumx(values(Table[ID]), if([Loss_of_Margin]>0,[Loss_of_Margin],blank()))

 

-ive

sumx(values(Table[ID]), if([Loss_of_Margin]<0,[Loss_of_Margin],blank()))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

Thank you so much!! This worked like a charm! 😄

View solution in original post

5 REPLIES 5
Thennarasu_R
Responsive Resident
Responsive Resident

Measure +IVE=
                 IF([MEASURE]>0,[Loss_of_Margin],bLANK())

MEASURE_IVE= IF([MEASURE]<0,bLANK(),[Loss_of_Margin])

selimovd
Super User
Super User

Hey @Sdhn420 ,

 

can you provide more information?

How does the measure look like? Values always need a context, positive/negative values by customer or by product or by day. In which context do you want to analyze?

 

Thank you and best regards
Denis
amitchandak
Super User
Super User

@Sdhn420 , for that you need a group by context

example

 

+ive =

sumx(values(Table[ID]), if([Loss_of_Margin]>0,[Loss_of_Margin],blank()))

 

-ive

sumx(values(Table[ID]), if([Loss_of_Margin]<0,[Loss_of_Margin],blank()))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hello @amitchandak , 

I found your answer and it work for my case with 1 condition. However, when i add 1 more condition, sumx total turn out wrong

I have data with 2 measue [Fcst order gap] & [%FR]

betty_bui2602_0-1666755432858.png

Order > Fcst =  sumx(values('MTD Attainment'[Material]), if([Fcst order Gap] > 0,[Fcst order Gap],blank()))
Order > Fcst - FR MISS = sumx(values('MTD Attainment'[Material]), if([%FR] < 1 && [Fcst order Gap] > 0,[Fcst order Gap],blank()))
By line it looks ok, but total is not right. Can you please help?
TIA 

Thank you so much!! This worked like a charm! 😄

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.