Forum Discussion

MrGorkajuice's avatar
MrGorkajuice
Frequent Visitor
6 years ago

Is this a bug?

Hi,

 

I'm seeing some weird behavior that I suspect is a bug. The most basic reproduction I can come up with is this:

 

Setup:
One table:

FilterColumnMeasureColumn
10
10
20
21

 

One measure that is intended to calculate all rows in the above table, respecting any filters applied to FilterColumn, but ignoring filters applied to MeasureColumn if present:

 

IgnoreMeasureColumnFilter = CALCULATE(COUNTROWS('Table');ALL('Table'[MeasureColumn]))
 
One slicer that filters on FilterColumn.
One Card visual that shows IgnoreMeasureColumnFilter. This visual contains has a basic filter: "MeasureColumn is 1".
 
The bug:
When the slicer is set to include all FilterColumn values, the visual shows 4. This is as expected, as the measure is ignoring the visual filter of MeasureColumn = 1. When the slicer is set to include only FilterColumn 2, the visual shows 2. This, again, is to be expected, because the FilterColum filter is respected, leaving two records to be counted. However, when the slicer is set to include only FilterColumn 1, the visual says (Blank). This, to me, suggests that the ALL-method is being ignored completely, which is weird given that it worked just fine when no filtering took place on FilterColumn.
 
Am I missing something?

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    MrGorkajuice - I'm not sure that this would be classified as a bug per se. Maybe. Have run into similar things and the "problem" is actually the Filter pane. I suspect that it is the Filter pane that is causing the issue as I have seen similar things with Report level and Page level filters. I'm thinking perhaps it is going like slicer filters -> visual level filter -> DAX

     

    So when you apply the visual level filter to the set coming back from the slicer you get nothing going to DAX so an ALL filter of nothing is still blank.

     

    I have attached a sample PBIX for others to experiment with. 

     

    You might want to submit this as an issue and see what comes back.

    • MrGorkajuice's avatar
      MrGorkajuice
      Frequent Visitor

      Thanks for the response. There definitely seems to be something to your explanation, as I can get around the issue by moving the MeasureColumn filter from the visual to a slicer. On the other hand, it also seems a bit more complicated, as the MeasureColumn 0 rows makes it to the DAX expression as long as the slicer filter doesn't completely reduce the dataset to 0 records...

       

      Thanks for confirming that it is indeed weird. I will submit it as an issue 🙂

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        Yeah MrGorkajuice I think it is some kind of optimization going on with the Filter pane. It's similar if you have a Page level filter, those things will never be included in DAX calculations because they essentially get pre-filtered out before getting to DAX. The Filter pane can definitely cause weird behavior. But, I agree that it's odd because it only happens in this case when the set gets filtered to zero.