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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

if subtracting value in aggregation

Hello, when I'm doing the conditional itself, checking the number and less than zero, the result is true and 0, if for false then and the original value. 

Exemple:

if [number] <0, 0, [number]

as it should return:

pay attention to the table total (aggregation)

productvalueif column
a1010
b-50
c-70
d11
e33
f11
total315

-------------------------------------------
how you're returning:

produtovalorse coluna
um1010
b-50
c-70
d11
e33
f11
total33

 

How do I fix it?

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , if [number] is a measure then try like

 

sumx(values(Table[Producto) , if([number] <0, 0, [number]) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

@Anonymous , As the grand total is calculated again, it does not have a row context. We use Values or summarize to push the group by visual so that grand total considers that and calculates each row by row and adds up

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , if [number] is a measure then try like

 

sumx(values(Table[Producto) , if([number] <0, 0, [number]) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you very much, worked as advised, could you please tell me the logic that built for this solution ?

@Anonymous , As the grand total is calculated again, it does not have a row context. We use Values or summarize to push the group by visual so that grand total considers that and calculates each row by row and adds up

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

fantastic, thank you again, I will subscribe to your channel to follow and thank you for the help !

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.