DAX Calculate function with and without FILTER

后端 未结 4 1789
庸人自扰
庸人自扰 2020-12-29 09:02

What is the difference in results of CALCULATE function if we use it with and without FILTER function. Suppose we have those two measures:

Measu         


        
4条回答
  •  庸人自扰
    2020-12-29 09:15

    The Measures you have created will have same output as you are only passing one value to filter as color "Red".

    But what if you want to pass range of values (like Date Range) to filter from, Measure1 wont work as it will not able to do that as it passes only single value to filter.

    In Measure2 you can pass range of specific values by using FILTER function from a specific table and column to get the desired output.

    Measure2 = CALCULATE([X], FILTER('FactTable', 'FactTable'[Color])

    You can use FILTER to reduce the number of rows in the table that you are working with, and use only specific data in calculations.

    You can find more details on FILTER function with example on how it works, here -

    https://msdn.microsoft.com/en-us/query-bi/dax/filter-function-dax

提交回复
热议问题