Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Cumulative Totals to specific date

Hi There,

 

I am going crazy trying to figure out how to calculate a cumulative total up to a date (for example, today). I've been working with this metric but it still give me value up to the end of the year:

 

Incid Acum FY up today =
VAR LastDataEntry =
CALCULATE ( LASTDATE ( Incidencias[Date] ); ALL ( Incidencias ) )
RETURN
IF (
SELECTEDVALUE ( Calendario[Date] ) > LastDataEntry;
BLANK ();
CALCULATE (
[Incidencias];
FILTER (
ALLSELECTED ( Calendario );
Calendario[Date] <= MAX ( Calendario[Date] )
)
)
)
 
Any ideas? 
 
Muchas gracias :)

2 Replies

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Icon for Community Support rankCommunity Support

    Anonymous 

     

    Make sure there is a relationship on Date column or change the DAX as follows.

                FILTER (
                    ALLSELECTED ( Incidencias ),
                    Incidencias[Date] <= MAX ( Calendario[Date] )
                )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-chuncz-msft 

      Tables are properly connected and i have tried to modify the metric as you proposed but still is showing whole year instead of up to a given date.

      I will keep on trying. Thanks anyway.