Forum Discussion
cumulative for certain period
- 10 years ago
oscarII - OK played with this a bit, tested some things out and fixed a column format issue on my end. Here is what I came up with that I believe will get you what you want:
Cumulative 2 = CALCULATE ( SUM ( 'Invoice lines'[Sales] ), FILTER ( ALLSELECTED(BI-Dates), 'BI-Dates'[Date] <= MAX ( 'BI-Dates'[Date] ) ) )The ALLSELECTED restricts the table returned to only the time range selected. I was able to put BI-Dates[Date] and Cumulative 2 in a table and watch the running total add up each day. I also used a [Month] column from BI-Dates and was able to get different (correct) cumulative totals for January versus February.
Greg_Deckler... Just one more point on this - the cumulative amount runs past the end of the available data and you end up with a graph looking like this:
Is there any way that the formula can be amended to only show where there is data against that particular date?
Thanks for the help.
Cumulative 2 = CALCULATE (
SUM ( 'Invoice lines'[Sales] ),
FILTER (
ALLSELECTED(BI-Dates),
'BI-Dates'[Date] <= MAX ( 'BI-Dates'[Date] )
&& 'BI-Dates'[Date] <= TODAY()
)
)Just remove all dates greater than the system date from the date dimension. && is the logical and operator.
- aruntd7710 years ago
Helper I
Hi,
I tried your approach to eliminate the future dates, however it is not filtering.
Cumulative Actual Units = CALCULATE(SUM('DWH W_ORDER_HEADER_D'[Sold Count]), FILTER(ALLSELECTED('DWH W_DAY_D'), 'DWH W_DAY_D'[CALENDAR_DATE] <= MAX('DWH W_DAY_D'[CALENDAR_DATE]) && 'DWH W_DAY_D'[CALENDAR_DATE] <= TODAY()))
Please help
Thanks
Arun
- Willborn10 years ago
Advocate III
Hi Arun
I struggle with the same issue. The expression <= TODAY() is somehow not working.
Did you solved this already? If yes - how?
Regards Patrick
- ChristianH9 years agoFrequent Visitor
Hi,
I ran in to the same problem and fixed it with a simple IF-statement, which sets the measure to zero if the MAX of date is higher than TODAY():
Cumulative no of leads = IF(max(Dates[Dates])>today(),0,CALCULATE(COUNTA('lead'[fullname]),Filter(ALLSELECTED(Dates),Dates[Date]<=max(Dates[Date])
Regards,
Christian