Forum Discussion

Analitika's avatar
Analitika
Post Prodigy
4 years ago

Filtering in calculation in Power BI

Hello,

 

I would like to ask why filtering not working in my calculations? I used this measure:

It was not in {"Skola tiekeju"} but I still see skola tiekjui values in visual. Why it happens?

9 Replies

  • FarhanAhmed's avatar
    FarhanAhmed
    Community Champion

    Since you are using || {OR} operater in your filter context. therefore your condition getting True for {"Skola tiekeju"} in values of  Operacija .

    • Analitika's avatar
      Analitika
      Post Prodigy

      So how to fix it because I need to exclude some data?

      • FarhanAhmed's avatar
        FarhanAhmed
        Community Champion

        try Use not in  expression of  {"Skola tiekeju"} with both || conditions 

         

        ||( Operacija  && not in  {"Skola tiekeju"})

        ||( Operacija  && not in  {"Skola tiekeju"})

  • _Gauta, EUR = 
    CALCULATE(
        [__Lik_Suma]
        ,FILTER(
            _APV,
            (CONTAINSSTRING([apyvarta.operacija],"Pajamavimas") && not [apyvarta.operacija] in {"Turto pajamavimas"}  && [apyvarta.operacija] not in {"Skola tiekÄ—jui"})
            || CONTAINSSTRING([apyvarta.operacija],"Gauta")
            || CONTAINSSTRING([apyvarta.operacija],"Pradinis")
    
        )
    )

    Hello,

     

    Why I still getting included if I filtered not in ("skola tiekejui"). I use not in. But still it is in visual. How to resolve this?