Forum Discussion

ValentinBIA's avatar
ValentinBIA
Resolver I
8 years ago
Solved

Variance over week (DAX)

Good morning Power BI community !   I'm sure my problem has an easy solution, but I haven't had the time to read "Learn to write DAX", I'm still focused on "M is for (data) monkeys" (almost done th...
  • Anonymous's avatar
    Anonymous
    8 years ago

    This should work:

     

    Total Rentals Previous Week =
    VAR selectedWeek = SELECTEDVALUE('Journeys by station'[Week])
    RETURN
        CALCULATE(
            [Total Rentals],
            'Journeys by station'[Week] = selectedWeek - 1
        )

    You may need some adjustment if you have values for the same week in different years.