Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

calculated column doesn't show blanks

I have a column in the dataset (Query), which has 3 values: 1, 0 and null. When creating visualizations, I figured I need a different representation of that column. So, I created a Calculated Column...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Anonymous

    This is the intended behaviour. Where boolean logic is involved, blanks are considered as having a numeric value of zero and boolean value of FALSE. What you are essentially saying here is, IF Col 1 = Zero or FALSE, then "No". A boolean comparison of a blank cell to the value of zero ( i.e. IF FALSE = FALSE) equates to TRUE and NOT FALSE, and hence the result. Therefore, one way is to not only compare the values, but also the datatype.

     

     

    CalcCol =
    IF (
        Table1[Col1] = 1,
        "Yes",
        IF ( ISNUMBER ( Table1[Col1] ) && Table1[Col1] = 0, "No", BLANK () )
    )