DAX Calculate function with and without FILTER

后端 未结 4 1793
庸人自扰
庸人自扰 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:12

    The DAX syntax of the automatic FILTER function generated by DAX in place of a logical expression requires that you express a single column in the filter expression. Let's take this example -

    Measure1 = CALCULATE([X], 'FactTable'[Color]="Red")
    

    The syntax above is internally transformed in the following one, which you might write in an explicit way obtaining the same behavior from your DAX measure.

    Measure1 = CALCULATE([X], FILTER(ALL('FactTable'[Color]), 'FactTable'[Color]="Red"))
    

    So If you use last function in Measure2 value it will fetch the same result.

    For further reference you can visit this link.

提交回复
热议问题