Forum Discussion

vika160's avatar
vika160
Icon for Helper III rankHelper III
4 years ago
Solved

Filter does not work in a measure

HI there,

 

It maybe a silly question, please, forgive me,  but I think it is crazy.

I have a table with column that has "IN" and "OUT" only value.

I need 2 very simple measures.

 

 Exams IN = CALCULATE(count(V_PBI_EXM_DATA1[ID]), V_PBI_EXM_DATA1[ExamProvider]="IN")
_Exams OUT = CALCULATE(count(V_PBI_EXM_DATA1[ID]), V_PBI_EXM_DATA1[ExamProvider]="OUT")

 

First measure works and return a correct value, second measure returns BLANK.

I  also tried this ways and it is the same BLANK value return: 

   Exams OUT = CALCULATE(count(V_PBI_EXM_DATA1[ID]), V_PBI_EXM_DATA1[ExamProvider] <>"IN")

_Exams OUT = CALCULATE(count(V_PBI_EXM_DATA1[ID]), FILTER(V_PBI_EXM_DATA1, V_PBI_EXM_DATA1[ExamProvider]= "OUT" ))

_Exams OUT = CALCULATE(count(V_PBI_EXM_DATA1[ID]), FILTER(V_PBI_EXM_DATA1, V_PBI_EXM_DATA1[ExamProvider]<> "IN" ))

 

Note:

there are no empty or null values in [ExamProvider] field, onlu IN and OUT

 In Power BI in  table  view mode I can see both values.

 

Any idea?

Thanks a lot!

 

  • powerbi/dax can be strange (but it will follow logic).  You might have seen the "auto-exist" problem but I would have to see the original pbix to know for sure. 

5 Replies

  • HotChilli's avatar
    HotChilli
    Icon for Community Champion rankCommunity Champion

    powerbi/dax can be strange (but it will follow logic).  You might have seen the "auto-exist" problem but I would have to see the original pbix to know for sure. 

    • vika160's avatar
      vika160
      Icon for Helper III rankHelper III

      I have a lot of data there that I cannot share. That is why I was trying to create new pbix with 2 tables only and stripped fields.  Is there a way to guide me where amd what  to look for?

       

  • HotChilli's avatar
    HotChilli
    Icon for Community Champion rankCommunity Champion

    Can you provide the pbix please and I'll have a look

  • Hi HotChilli,

     

    I created new pbix and did a table copy with few columns only. imported Calendar table.

    Both measures seems work properly.

     

    If I link 2 filtered tables to my original  pbix - one for IN and another for OUT -- measures work as well.

     I am wondering if there is something in a table I have to look for? 

     still it is strange but you never know.

     

    Thank you

  • I deleted the table form PBI and relinked it again. it is working now. So strange. 
    Thank you for your help!