Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure not applying filter correctly

Hi powerbi community

 

I'm trying to do count on columns, in the case i get a match on certain criteria, but my measure is ignoring the global context (as in, if i filter on the criteria itself on the case where i should get no values, my result stays the same instead of 0.

 

I've been able to recreate the problem with smaller data:

 

dataid
red1
orange2
red3
orange4
red5
yellow6
blue7
orange8
blue9
orange10

 

Here "Data" and "id" are read as text.

The measures are :

 

Measure2 = MAX(COUNT(aTest[id]),0)
Measure 3 = CALCULATE([Measure2], aTest[id] = "3")

 

The expected result is that if I create a slicer on "ID" and select anything but "3", i should get 0.

But here is the result i get :

I noticed that "Measure 3" returns 1 whenever i choose an id with "Data" value "red".

 

Could someone explain me this behaviour and how to get the expected result please ?

Thank you