Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Remove filter on single table "issue"

Hi, I was playing around with filtering on single table and... ended up with some serious doubts about my mental health :D. Need assistance if filtering removal is behaving correctly (and why, if so)? For testing purpose, I created simple 3x3 table on blank report – two columns to be used by selectors and one basic measure summing the third one. Pasting below 5 different scenarios, after manipulating (clicking/selecting) only single selector:
1. Baseline – measureA drops filtering of SelectorZ and sums all rows – all good
2. Selecting single value within SelectorA clashes the measure – why, if it should drop filter on SelectorZ (similarly to baseline case) and indicate “1”?
5. Selecting two values (one that shares the same row) clashes also – shouldn't be “101” (still unable to drop the filter on SelectorZ)?
3. & 4. Selecting all values, but differently – once by “select all” option (3), another time by clicking 3x on each item (4) returns different result - ...

Apart of allexcept(), I've checked also all() and removefilters() on selected column and they all "work" alike. All comments will be helpful, thx.

  • Hey Anonymous ,

     

    you are facing the "dreaded one-table solution" that is implicit with the concept of auto exists.

    This concept is described in this article https://www.sqlbi.com/articles/understanding-dax-auto-exist/

     

    Consider to create a star schema, meaning create separate tables for each of the columns inside your fact table, except the numeric columns that will be used as measures.

     

    Regards,

    Tom

3 Replies

  • Hey Anonymous ,

     

    you are facing the "dreaded one-table solution" that is implicit with the concept of auto exists.

    This concept is described in this article https://www.sqlbi.com/articles/understanding-dax-auto-exist/

     

    Consider to create a star schema, meaning create separate tables for each of the columns inside your fact table, except the numeric columns that will be used as measures.

     

    Regards,

    Tom

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Tom,
      normally I use dictionary tables, as you're suggesting. I was wondering though why such feature exist, your explanation & article were really helpfull. Thanks again for not only precise but rapid resonse.

      To Icey,
      the measure and whole example was created as a sandbox. The idea was to drop one filter (hence allexcept() function) and sum over the rest which is <> what you're suggesting. Nevertheless thanks for contribution.

  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

    Why do you create your measure like below? 

    MeasureA = CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[SelectionA] ) )

    Why not just like this?

    MeasureA = SUM ( 'Table'[Value] )

     

     

    Best Regards,

    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.