Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 years ago

measurement error

I have a measure in which I make a calcuclo and a treatment for when the value is null or blank and also applying a filter, the measure is as follows:

13th Salary = CALCULATE (IF (ISBLANK (CALCULATE (sum (FTEGRH_ItemServidor [vlvalor]); Tipo_evento [type] = "13th salary")); 0; CALCULATE (sum (FTEGRH_ItemServidor [vlvalor]); Tipo_evento [type] = "13th Salary")))

when I do not use the condition ISBLANK values are presented smoothly despite showing in brnaco some but to apply the function ISBLANK the report missed the filter featuring all zero values, what I'm missing?

5 Replies

  • Sean's avatar
    Sean
    Community Champion

    Anonymous Try without the first CALCULATE

     

    13th Salary =
    IF (
        ISBLANK (
            CALCULATE (
                SUM ( FTEGRH_ItemServidor[vlvalor] );
                Tipo_evento[type] = "13th salary"
            )
        );
        0;
        CALCULATE (
            SUM ( FTEGRH_ItemServidor[vlvalor] );
            Tipo_evento[type] = "13th Salary"
        )
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Sean

      the same thing happens

       

       

       

      • kcantor's avatar
        kcantor
        Community Champion

        Try simplifing your calculation using a calculated column from an IF statement. Create a column in the data where if it is blank it shows 1 and if it is not blank use 0.

        Then, in your calculation filter by that condition.