Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
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 though).
I'm trying to get the variance over week of my rentals but I cannot figure out how to do it, since PowerBI does not have a function such as YTD for weeks.
To get the variance, I know I need to first have the value of the previous week, and this is where I struggle.
Here is an image of my dataset. I already have a measure on my report for the total value of each week (Total Rentals = SUM('Journeys by station'[Value])). How can I get the same result for the previous week ?
Thank you very much for your help.
Best,
Valentin
Solved! Go to Solution.
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.
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.
Hey @Anonymous, thank you very much, that is exactly what I was looking for !
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 22 | |
| 22 | |
| 21 | |
| 20 | |
| 12 |
| User | Count |
|---|---|
| 58 | |
| 55 | |
| 42 | |
| 36 | |
| 35 |