Forum Discussion
Annual cumulative measures between dates
- 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.
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.
- JmSahuco5 years agoFrequent Visitor
Me ha servido mucho la solución, sólo he tenido que realizar un ligero cambio
funcion = var fmin=min('2-Calendario'[Date])var fmax=max('2-Calendario'[Date])return calculate(sum( table[cant]), FILTER( ALL(table),table[Fecha_Inicio]<=fmax&&table[Fecha_Fin]>=fmin))