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
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
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.