Forum Discussion
Anonymous
7 years agoNot applicable
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] )
)
)
)
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
Community 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] ) )- AnonymousNot applicable
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.