Forum Discussion

G23's avatar
G23
Frequent Visitor
3 years ago
Solved

Calculating Growth Based on Multiple or Single Year Chicklet Selection

Hello,   I've been trying to wrap my head around how to go about building a measure based on selectedvalue to calculate year over year growth. I have a chicklet slicer with selections for fiscal ye...
  • AlexisOlson's avatar
    3 years ago

    I think you can cover all the scenarios by just looking at the max and min FY selected.

    RevGrowth =
    VAR MinFY = MIN ( Dim_Date[FiscalYear] )
    VAR MaxFY = MAX ( Dim_Date[FiscalYear] )
    VAR RevMinFY = CALCULATE ( [Revenue], TREATAS ( { MinFY }, Dim_Date[FiscalYear] ) )
    VAR RevMaxFY = CALCULATE ( [Revenue], TREATAS ( { MaxFY }, Dim_Date[FiscalYear] ) )
    RETURN
        IF ( MinFY = MaxFY, RevMaxFY, RevMaxFY - RevMinFY )