Forum Discussion
Switch/IF condition ignores 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.
Hi Anonymous
what is the column Hour? is it calculated? are you sure it is exactly zero, not rounded decimal like 0.0000001?
Hi az38 , Thanks for response.
I understand the problem, in my condition I initially put criteria for blank() =0 (where 0 is taken as blank), so it has taken as zero, even if I try to change the criteria to multiple times it was taking into effect.
So I changed zero values to 1 in power query(Where zero values needs to taken into consideration not blank values) and calculated with switch condition with same expression it worked.
- dax6 years agoCommunity Support
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.