Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Switch/IF condition ignores zero

Hi Everyone,   While using DAX switch or if, condition ignores zero values.   Eg. In my case Im calculating Hour >=0 && Hour<4, it ignores zero values and executing values greater than zero.   ...
  • dax's avatar
    dax
    6 years ago

    Hi Anonymous , 

    You also could refer to below calculated column for details.

    Column = switch(TRUE(),ISBLANK('Table'[Hour]),0,'Table'[Hour]>=0 && 'Table'[Hour]<4,1,'Table'[Hour]>=4,0)

     You could refer to BLANK-is-caught-as-0-in-Columns  for details.

    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.