Forum Discussion
aristotle
5 years agoRegular Visitor
Total sum for consecutive period
Hello Dax gurus!, I have the count for each consecutive month in the below screen shot. What i want to get is the values in the Total column. For each consMonth 1,2,3,4....., i want to add up t...
Jos_Woolley
Solution Sage
5 years agoHi,
Total =
VAR ThisStartMonth = 'Table'[Startmonth]
VAR FirstMonth =
CALCULATE (
MAX ( 'Table'[Startmonth] ),
FILTER (
'Table',
'Table'[Startmonth] <= ThisStartMonth
&& 'Table'[consMonths] = 1
)
)
RETURN
CALCULATE (
SUM ( 'Table'[Count] ),
FILTER (
'Table',
'Table'[Startmonth] >= FirstMonth
&& 'Table'[Startmonth] <= ThisStartMonth
)
)Regards