Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Sum till selected month

Hey there,

 

I want to calculate the total amount till the selected month in the slicer. I´ll show the result in a card.

 

 

  • Anonymous , No clear Try like

    Till Date =
    VAR _max = MAXX(Allselected('Calendar'), 'Calendar'[DATE] )
    return 
    CALCULATE (
    SUM ( Sales[amount] ),
    FILTER ( all('Calendar'),'Calendar'[DATE] <=_max),
    )

3 Replies

  • Anonymous , No clear Try like

    Till Date =
    VAR _max = MAXX(Allselected('Calendar'), 'Calendar'[DATE] )
    return 
    CALCULATE (
    SUM ( Sales[amount] ),
    FILTER ( all('Calendar'),'Calendar'[DATE] <=_max),
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      It works perfectly, it was what I looking for.  Thank you.

  • Anonymous 

     

    Please see the DAX below.

    Measure = 
    VAR maxdate=max('Table'[date])
    return CALCULATE(sum('Table'[value]),FILTER('Table','Table'[date]<=maxdate))

    Hope this is helpful