Forum Discussion

HungFan's avatar
HungFan
Regular Visitor
3 years ago
Solved

Regarding the DATEADD working with modifier ALL('Date')

Hi all,
I have a normal model with 'Date' and 'Sales' tables. And I have 3 measures,

  1. The first one is Sales Amount := SUMX('Sales', [Quantity] * [Net Price])
  2. The second one is Sales AllDate := CALCULATE( [Saltes Amount], ALL('Date'))
  3. The last one is Sales PM in AllDate := CALCULATE( [Saltes Amount], DATEADD('Date'[Date], -1 ,MONTH), ALL('Date'))

I put them in a matrix, but I don't understand the behavior of the last measure, why the ALL modifier doesn't remove the filter of DATEADD? It's like the measure of CALCULATE( [Saltes Amount], DATEADD('Date'[Date], -1 ,MONTH))
Could someone please explain it to me. Thanks!

  • HungFan 

    Becuase it is not supposed to. It only removes the outer filter which is then replaced by the inner filter. However, it is mostly useless to have ALL along with DATEADD as it removes the filter automatically from the date table. 

2 Replies

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    HungFan 

    Becuase it is not supposed to. It only removes the outer filter which is then replaced by the inner filter. However, it is mostly useless to have ALL along with DATEADD as it removes the filter automatically from the date table. 

    • HungFan's avatar
      HungFan
      Regular Visitor

      tamerj1 

      Thank you for reminding me the key point that ALL, used in CALCULATE, only remove the outer filter.

      I understand it right now.