Forum Discussion

curtismob's avatar
curtismob
Helper IV
3 years ago
Solved

Override Year Slicer For Previous Measure

Hello, I have a matrix with monthly costs, along with the variances from month to month.  I have a slicer to select the year, but I also want to inlcude the cost for the previous December, in order t...
  • Pady's avatar
    Pady
    3 years ago

    Sorry about the previous post. The following formula works

    DecCostPriorYr =
    VAR YearSelectedLessOne =
    SELECTEDVALUE(PlanCost[Year]) - 1

    VAR CostCalc =
    CALCULATE(SUM(PlanCost[Cost]),
    FILTER(ALL(PlanCost[Community],PlanCost[Month],PlanCost[Year]),
    PlanCost[Month] = 12 && PlanCost[Year] = YearSelectedLessOne))

    RETURN
    CostCalc