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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
aishak12
Helper IV
Helper IV

IF statement for negative number to equal 0

aishak12_0-1612191223302.png

Hi All, Im looking to create an IF statement that if the value returns a negative number to replace it with 0. I can't filter out the negative numbers since I need there values in other coloumns. 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@aishak12 , Not very clear

A new column

if([OT Hours] <0 ,0, [OT hours])

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

2 REPLIES 2
Pragati11
Super User
Super User

Hi @aishak12 ,

 

You can create a calculated column using DAX as follows:

replaceCol = IF(tablename[col] < 0, 0,  tablename[col] )

In the above DAX replace tablename[col] with your table name and column name.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

amitchandak
Super User
Super User

@aishak12 , Not very clear

A new column

if([OT Hours] <0 ,0, [OT hours])

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors