Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Unusual Filter Behavior - Filter Context Not Being Removed as Expected

I have a Sales fact table with the following fields:   [Sales Amount] [Sales Quantity] [Item] [Item Revision] [Sales Period] (a text field in the format of YYMM) [Customer] [Sales Region]   ...
  • Anonymous's avatar
    Anonymous
    7 years ago

    I finally found a solution to this problem after encountering it again in a new problem set. This post on the forums:

    https://community.powerbi.com/t5/Desktop/Make-measure-ignore-specific-filter/m-p/670629/highlight/true#M322711

    led to this enlightening article:

    https://www.sqlbi.com/articles/understanding-dax-auto-exist/

    Long story short, when applying multiple filters from the same table, Power BI optimizes by consolidating what would be multiple queries into one. The resultant table will only include results for records that have that have that particular combination of filters; if a particular combination of values for those two (or more) fields didn't exist in your filtered set, CALCULATE( . . . ALL([Fieldname] ) won't get them back for you!

     

    The recommendation is to use a dimensional model (e. g., star schema) to avoid filtering a table by its own fields.