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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
kati70
Regular Visitor

How can I convert negative value to zero

Hi,

 

I couldn't find a solution for this, so I really do hope that someone can support with this.

I have calculation where negative values should be converted to zero. Any ideas?

Thanks a lot,

-Kati

 

4 REPLIES 4
Baskar
Resident Rockstar
Resident Rockstar

Ya we can do . 

 

If (  measure < 0 , 0 , measure )

 

 

thats it. 

 

let me know if any further help.

Anonymous
Not applicable

I am wondering if this is the optimal way or if using the function max( measure, 0) performs quicker.

 

(apologies for ressurecting an old thread!)

epieters
Frequent Visitor

Test if the number is negative, and if so, add the abolute value of that number.

That will give you the zero.

 

IF( [Number] < 0, [Number] + ABS( [Number] ), [Number] )

 

Cheers,

 

--Eric.

 

skasper
Responsive Resident
Responsive Resident

Have you tried adding a conditional column? See example below. Of course with your own column names. I am the first to admit that this is not very elegant, but it should work until you have a better solution.

 

Clipboard01.jpg

Best - Sascha
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.