Forum Discussion

akowalski's avatar
akowalski
Frequent Visitor
8 years ago
Solved

Calculating difference from previous period

Hello, How can i calculate difference from previous period, when 2 years are selected from slicer. It can be 2017, 2018 but also 2015 and 2018. I have a list of countries on a column/line chart, ev...
  • Floriankx's avatar
    8 years ago

    Hello,

     

    so you want to use slicer to slice for this year and previous year?

     

    Ja can differ using Calculate

    MeasureMin=
    VAR MinSlicedYear=CALCULATE(MIN(DateTable[Year]),ALLSELECTED(DateTable[Year])
    RETURN
    CALCULATE(Sum(Values),FILTER(FactTable,YEAR([DateColumn)=MinSlicedYear))

    MeasureMax is analog.

     

    I don't know if this fullfills your purpose exactly but give it a try and let me know.

     

    Best regards.