Forum Discussion

GOT2021's avatar
GOT2021
Frequent Visitor
1 year ago

Measure repalce blank with 0 vs Column

Hi, 
My first measurement looks like this :
Mesure_1 =
var a = CALCULATETABLE(
                                        FILTER(data_test,
                                        data_test
[day]
                                                )
                                       )
var b = SUMX(a, [nb_id])
 
RETURN b

But this measure doesn't always show me the values, so I tried two methods:

  1. modify as follows
Measure_1 =
var a = CALCULATETABLE(
                                        FILTER(data_test,
                                        data_test
[day]
                                                )
                                       )
var b = SUMX(a, [nb_id])

var c = IF(ISBLANK(b), 0, b)

RETURN c

       2. Create a new column
col_no_blanck = IF(ISBLANK([Measure_1 ]), 0, [Measure_1 ])


Results:

with method a ==> My Table segment is no longer sensitive to my filter segment
with method b ==> incorrect values in segment Table 2496 instead of 332

 


 

 

Do you have any tips for me, please?



2 Replies

  • GOT2021 if you can paste the sample data with the expected output, it will help to provide the solution. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, GOT2021 

    Thanks for parry2k's reply. Are you currently addressing this problem? Based on your description, I tried to reproduce it, but unfortunately, it didn't work if the nb_id is a filed. So, if the nb_id is a measure, I think it's the problem. As parry2k said, can you provide some of the non-sensitive data for us to reproduce your situation.

     

    Best Regards,
    Yang

    Community Support Team