Forum Discussion

aishak12's avatar
aishak12
Icon for Helper IV rankHelper IV
5 years ago
Solved

IF statement for negative number to equal 0

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. 

 

2 Replies

  • 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