DAX Difference between naked SUM and sum wrapped in CALCULATE

前端 未结 3 560
走了就别回头了
走了就别回头了 2021-01-18 06:50

What is the difference between naked SUM and sum wrapped in CALCULATE?

Measure1 = SUM( tab[col1]) )
Measure2 = CALCULATE ( SUM( tab         


        
3条回答
  •  佛祖请我去吃肉
    2021-01-18 07:30

    When CALCULATE is used in a row context, transition will occur where each row becomes a filter and the entire table is scanned for each row, using all the columns of the row as a filter. This will have an impact on performance and it could also cause unexpected results if your table has duplicates.

    It's possible the two versions you have provided will return the same value. However, if they don't it's probably because of duplicate rows in your table.

    You might find this article very useful.

提交回复
热议问题