Forum Discussion
Anonymous
6 years agoNot applicable
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. ...
- 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 ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
az38
6 years agoCommunity Champion
Anonymous
sorry, I also see, you return 0 when Hour is plank. try to replace your conditions in switch like
SWITCH(TRUE(),
[Hour] >=0 && [Hour] < 4, 1,
0
)