Forum Discussion

Tavi_'s avatar
Tavi_
Frequent Visitor
2 years ago
Solved

Cumulative Cartons Forecasted

Hi,

I use this formula for the cumulative total of forecasted cartons.

_Forecast Cartons Cumulative = CALCULATE(
[_Forecast Cartons],
    FILTER(
        ALL('[DIM] Date'[Date]),
        '[DIM] Date'[Date] <= MAX ('[DIM] Date'[Date]))
)
 
But how do I adjust the formula so the formula starts counting from today? So my figures will look like this
 
  • Tavi_ OK, didn't understand that from the original post:

    _Forecast Cartons Cumulative = 
    VAR __Value = CALCULATE(
    [_Forecast Cartons],
        FILTER(
            ALL('[DIM] Date'[Date]),
            '[DIM] Date'[Date] <= MAX ('[DIM] Date'[Date]) && '[DIM] Date'[Date] >= TODAY() )
    )
    VAR __Result = IF( MAX('[DIM] Date'[Date]) < TODAY(), BLANK(), __Value )
    RETURN
    __Result

4 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Tavi_ 

    _Forecast Cartons Cumulative = 
    VAR __Value = CALCULATE(
    [_Forecast Cartons],
        FILTER(
            ALL('[DIM] Date'[Date]),
            '[DIM] Date'[Date] <= MAX ('[DIM] Date'[Date]))
    )
    VAR __Result = IF( MAX('[DIM] Date'[Date]) < TODAY(), BLANK(), __Value )
    RETURN
    __Result
  • Hii You can use this DAX Instead
    Forecast Cartons Cumulative =
    CALCULATE (
    [_Forecast Cartons],
    FILTER (
    ALLSELECTED ( '[DIM] Date'[Date] ),
    '[DIM] Date'[Date] <= MAX ( '[DIM] Date'[Date] )
    )
    )

    If this solution helped you please give a thumbs up and accept this reply as a solution!!
    Thank You!! Regards!!
     



  • Tavi_'s avatar
    Tavi_
    Frequent Visitor

    Khushidesai0109 your formula shows me this figures

     

    Greg_Deckler your formula shows me this figures

     

    Both not the figures I'm looking for. De formula must ignore al the cartons before today. 

    • Greg_Deckler's avatar
      Greg_Deckler
      Community Champion

      Tavi_ OK, didn't understand that from the original post:

      _Forecast Cartons Cumulative = 
      VAR __Value = CALCULATE(
      [_Forecast Cartons],
          FILTER(
              ALL('[DIM] Date'[Date]),
              '[DIM] Date'[Date] <= MAX ('[DIM] Date'[Date]) && '[DIM] Date'[Date] >= TODAY() )
      )
      VAR __Result = IF( MAX('[DIM] Date'[Date]) < TODAY(), BLANK(), __Value )
      RETURN
      __Result