Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Simple IF testing on 0 & 1

Hello Power BI Community,   this question could seem a little dumd, but the fact that IF fucntion requires a function as a testing TRUE/FALSE has blocked me several times. In excel it is easy since...
  • v-danhe-msft's avatar
    7 years ago

    Hi Anonymous,

    From your description, could you mean to judge each row in a column? If so, you could refer to below formula:

    T/F = IF([Test]=0,TRUE(),FALSE())

    Result:

     

    Regards,

    Daniel He

     

  • v-danhe-msft's avatar
    v-danhe-msft
    7 years ago

    Hi Anonymous,

    You could refer to below measure:

    Measure = IF(CALCULATE(SUM(Table1[Number]))=0,TRUE(),FALSE())

    Result:

    Hope it could help you.

     

    Regards,

    Daniel He

  • Anonymous's avatar
    Anonymous
    7 years ago

    Hello Daniel,

     

    well the objective was not to create new data, so no I a DAX mesure is requirered and not a column formula.

     

    I got to this solution: IF(SUMX( table, Column name = 1 ; Result if true,; resulat if false)

     

    SUMX is an iterating function that is checking row after row informations.

     

    Thanks for your help.

     

    Mark