Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ValentinBIA
Resolver I
Resolver I

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 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.

 

Image and video hosting by TinyPic

 

 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

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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 !

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.