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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculation with Execption

Hi all,

 

i have a small problem with a simple calculation.

I have two relevant Columns: Counterparty and Netting Amount.

It has to be calculated in it the following way: 

Sum Netting Amount (except negative Values), but if the Counterparty is "ABC", then i want to include all values (no matter if negative or positive).

 

Does anybody have a solution for this small calculation?

BR

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Does lbendlin solve your problem? As lbendlin says, I created a simple example to better understand:

SUM = CALCULATE(SUM('Table'[Netting Amount]),FILTER(ALL('Table'),[Netting Amount]>0||'Table'[Counterparty]="ABC"))

The final output is shown below:

vyalanwumsft_0-1638844876242.png

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Does lbendlin solve your problem? As lbendlin says, I created a simple example to better understand:

SUM = CALCULATE(SUM('Table'[Netting Amount]),FILTER(ALL('Table'),[Netting Amount]>0||'Table'[Counterparty]="ABC"))

The final output is shown below:

vyalanwumsft_0-1638844876242.png

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Here is the pseudo code:

 

Calculate (sum(netting amount),[netting amount]>0 || {CounterParty]="ABC")

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.