Forum Discussion
Cumulative values from Specific Date
- Anonymous3 years ago
Hi Anonymous ,
Here I create a sample to have a test and I think you can try below code to create a measure.
Sample:
Measure:
Measure = VAR _START = EOMONTH(TODAY(),-2)+1 RETURN CALCULATE(SUM('Table'[Sales]),FILTER(ALL('Table'),'Table'[Date]>=_START&&'Table'[Date]<=MAX('Table'[Date])))+0Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous,
I see two issues there.
First one to solve is the date filter. I used a variable, where I filtered the Sales by TodayM-1.
Second issue is much easier as you can cumulated the variable as any other cumulated sum by filtering allselected dates with isonorafter(Date, max(date), descendants).
I hope this one helps you:
Cumulated Values =
var SalesfromMminus1 = Calculate(Sum(Sales[Sales]),Filter('Dim Datum','Dim Datum'[DatumBK] >= DATE (YEAR (TODAY()), MONTH ( TODAY () ) - 1, DAY ( TODAY () - 1 ) )))
return
CALCULATE(
SalesfromMminus1,
FILTER(
ALLSELECTED('Dim Datum'[DatumBK]),
ISONORAFTER('Dim Datum'[DatumBK], MAX('Dim Datum'[DatumBK]), DESC)
)
)____________________________
You want more helpful tipps and tricks like that?
Please subscribe: https://www.youtube.com/channel/UC2lAgCgfyLCHsRv0h-ETBWQ
- Anonymous3 years agoNot applicable
Hello TypimWuerfel
Thank you for your reply. However, the measure doesn't work and it returns the same value as the non cumulated. Please note that my measure that I want to comulate is as follows (I don't know if this changes anything) :
CALCULATE([Value],PARALLELPERIOD('D_Calendar'[Date],1,MONTH))