Forum Discussion

orana's avatar
orana
Icon for Helper I rankHelper I
4 years ago
Solved

User determined variable in calculation

I'm looking to see if there is a way to take the difference between two variables  1. average sales in 2019 and 2020 for product B-A 2. sales in "x" year for product M-A, where "x" would be determine...
  • PabloDeheza's avatar
    PabloDeheza
    4 years ago

    Try changing the first calculate to this:

    CALCULATE(
        SUM( 'PL Portfolio'[Trace Units] ),
        'PL Portfolio'[Fiscal Year] <= 2020,
        ALL( 'PL Portfolio'[Fiscal Year] ),
        'PL Portfolio'[B & M] = "B - A"
    )