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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Calculating measures

I'm trying to calculate a measure e.g Total Profit = Calculate(Sum('Salesdata'[Profit]), ('Salesdata' [State] = "Vic")). I've realised that have some of the data has negative values ie (Loss). I want to sum all the Total Profit in a new measure with only profit values >0. I want to exclude all the 'loss' values as it affects my new measure by decreasing the total amount. 

 

I have used this formula
Total Profit =
VAR profit = Calculate(Sum('Salesdata'[Profit]), ('Salesdata' [State] = "Vic"))

RETURN (profit>0) 
Please help..

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your data mode looks like, but please try to create the measure similar to the below.

thanks.

 

Picture1.png

 

Total Profit only positive and Vic : =
VAR _newtable =
FILTER ( Salesdata, Salesdata[Profit] > 0 && Salesdata[State] = "Vic" )
RETURN
SUMX ( _newtable, Salesdata[Profit] )

 

 

 

Link to the sample pbix file 

 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your data mode looks like, but please try to create the measure similar to the below.

thanks.

 

Picture1.png

 

Total Profit only positive and Vic : =
VAR _newtable =
FILTER ( Salesdata, Salesdata[Profit] > 0 && Salesdata[State] = "Vic" )
RETURN
SUMX ( _newtable, Salesdata[Profit] )

 

 

 

Link to the sample pbix file 

 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

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.