DAX REMOVEFILTERS vs ALL

后端 未结 1 774
甜味超标
甜味超标 2021-01-27 01:58

How to substitute REMOVEFILTERS in the following code with old school functions ALL and VALUES instead? This exercise is just to better understand REMOVEFILTERS.



        
1条回答
  •  北恋
    北恋 (楼主)
    2021-01-27 02:52

    REMOVEFILTERS is just an alias of ALL here, so it works just the same.

    Basically, ALL returns a table including all rows, ignoring any filters that might have been applied.

    However, when ALL is used as a filter argument of CALCULATE or CALCULATETABLE, it behave totally differently: it removes filters from the table and does not return a table.

    To alleviate this confusing behavior of ALL, REMOVEFILTERS was introduced to replace ALL when it is used inside CALCULATE.

    For more details, you may look at this article. https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept/

    0 讨论(0)
提交回复
热议问题