Forum Discussion
Anonymous
6 years agoNot applicable
Filtered Running Total
Trying to create a prior 7 years Total in the Install Base row, so first year that should be displayed in this row would be 2015, and it would pull from Total Sold row for years 2008-2014. Looking a...
- 6 years ago
Hi Anonymous ,
You can try this:
previous 7 years total = CALCULATE ( [Total Sold], DATESINPERIOD ( 'Whole Goods'[Fiscal Date], LASTDATE ( 'Whole Goods'[Fiscal Date] ), -7, YEAR ) )Install Base = VAR mindate = CALCULATE ( MIN ( 'Whole Goods'[Fiscal Date] ), ALLSELECTED ( 'Whole Goods'[Fiscal Date] ) ) RETURN IF ( YEAR ( MAX ( 'Whole Goods'[Fiscal Date] ) ) - 7 < CALCULATE ( YEAR ( FIRSTDATE ( 'Whole Goods'[Fiscal Date] ) ), ALL ( 'Whole Goods' ) ), BLANK (), CALCULATE ( [previous 7 years total], FILTER ( ALL ( 'Whole Goods' ), DATEADD ( 'Whole Goods'[Fiscal Date], 1, YEAR ) <= MAX ( 'Whole Goods'[Fiscal Date] ) && DATEADD ( 'Whole Goods'[Fiscal Date], 1, YEAR ) >= mindate ) ) )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Icey
6 years agoCommunity Support
Hi Anonymous ,
You can try this:
previous 7 years total =
CALCULATE (
[Total Sold],
DATESINPERIOD (
'Whole Goods'[Fiscal Date],
LASTDATE ( 'Whole Goods'[Fiscal Date] ),
-7,
YEAR
)
)Install Base =
VAR mindate =
CALCULATE (
MIN ( 'Whole Goods'[Fiscal Date] ),
ALLSELECTED ( 'Whole Goods'[Fiscal Date] )
)
RETURN
IF (
YEAR ( MAX ( 'Whole Goods'[Fiscal Date] ) ) - 7
< CALCULATE (
YEAR ( FIRSTDATE ( 'Whole Goods'[Fiscal Date] ) ),
ALL ( 'Whole Goods' )
),
BLANK (),
CALCULATE (
[previous 7 years total],
FILTER (
ALL ( 'Whole Goods' ),
DATEADD ( 'Whole Goods'[Fiscal Date], 1, YEAR )
<= MAX ( 'Whole Goods'[Fiscal Date] )
&& DATEADD ( 'Whole Goods'[Fiscal Date], 1, YEAR ) >= mindate
)
)
)
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
This solution worked, thank you Icey!