Forum Discussion
JmSahuco
5 years agoFrequent Visitor
Annual cumulative measures between dates
Hello everyone I have a problem when making a cumulative sum, I explain, I have a table with a quantity and two fields date, from and to, I want to make the cumulative sum of the amount (which is a...
- 5 years ago
JmSahuco Do you have a DimDate table? Is it unrelated to the table with Cant, ID, in it?
You can try something like:
Total Measure =
VAR _MinDate = MIN(DimDate[Date])
VAR _MaxDate = MAX(DimDate[Date])
RETURN
SUMX(FILTER(Table), Table[StartDate] <= _MaxDate && Table[EndDate] >= _MinDate), Table[Cant])
Then put DimDate values in the visualization along with the measure above.
Ashish_Mathur
Super User
5 years ago