Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Slicer and measure using same column

Hello, 
I am almost certain that this isn't how PBI was working before, but anyways, how can I avoid this behaviour? 

Example table: 

Measures: 

londons = CALCULATE(COUNT('Table'[country]),'Table'[city] = "london")
rows = COUNT('Table'[city])
Unfiltered version: 

 

If I filter by city, to be just "dublin", why do I still have in "londons" measure value 1 instead of 0/ blank? 

How can I make it 0? 

  • Hey Anonymous ,

     

    you override the filter context with:

     

    'Table'[city] = "london"

     

     

    So it doesn't matter what you choose, you always override it with London. And that was always like that.

    If you don't want that, remove that part of the formula.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     

3 Replies

  • selimovd's avatar
    selimovd
    Icon for Most Valuable Professional rankMost Valuable Professional

    Hey Anonymous ,

     

    you override the filter context with:

     

    'Table'[city] = "london"

     

     

    So it doesn't matter what you choose, you always override it with London. And that was always like that.

    If you don't want that, remove that part of the formula.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
    • Anonymous's avatar
      Anonymous
      Not applicable

      I see, I completely forgot that if I want to have it filtered by both (slicer and measure) I have to use FILTER

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

    Anonymous If I am not mistaken, this is a case of your filter context being executed before your query context, which I am pretty sure that's how it has always been.