Forum Discussion

Rachitik67's avatar
Rachitik67
Frequent Visitor
2 years ago
Solved

Variation week over week with a baseline

Hi,  i am trying to calculation the variation between weeks. However, i want the current week to be the baseline.   For example :  Variation current week vs week 16 = current week - week 16 / wee...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi  Rachitik67 ,

     

    Here are the steps you can follow:

     

    You can use the following dax.

    Calculated column:

    Column =
    var _currentweek=
    MAXX(ALL('Table'),'Table'[No de Semaine])
    var _currentvalue=
    SUMX(
        FILTER(ALL('Table'),'Table'[No de Semaine]=_currentweek),[Inscr_this_week])
    return
    DIVIDE(
    _currentvalue - 'Table'[Inscr_this_week],'Table'[Inscr_this_week])

    Measure:

    Measure =
    var _currentweek=
    MAXX(ALL('Table'),'Table'[No de Semaine])
    var _currentvalue=
    SUMX(
        FILTER(ALL('Table'),'Table'[No de Semaine]=_currentweek),[Inscr_this_week])
    return
    DIVIDE(
    _currentvalue - MAX('Table'[Inscr_this_week]),MAX('Table'[Inscr_this_week]))

     

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly