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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Difference between Dates(Weeks)

Hello I have a couple of fields 

Week and Avgerage of Rounded Open Hours, I want to calcualte the difference between weeks
difference between 8/29/2022- 8/22/2022.

How do I do that?

rzeichner_0-1662985123232.png

Thanks!

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could create a measure like 

Week on week diff =
VAR thisWeek =
    SELECTEDVALUE ( 'Table'[Week] )
VAR thisWeekValue =
    SELECTEDVALUE ( 'Table'[Average of Rounded Open Hours] )
VAR lastWeekValue =
    LOOKUPVALUE (
        'Table'[Average of Rounded Open Hours],
        'Table'[Week], thisWeek - 7
    )
RETURN
    thisWeekValue - lastWeekValue

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your data model looks like, but I tried to create a sample pbix file like below.

The below sample shows how to find the previous week's data.

I hope the below can provide some ideas on how to create a solution for your dataset.

Jihwan_Kim_1-1662986965145.png

 

 

Jihwan_Kim_0-1662986952761.png

 

Prev. week avg open hrs: =
CALCULATE (
    [Avg of open hours:],
    'Calendar'[Start of Week]
        = MAX ( 'Calendar'[Start of Week] ) - 7
)

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Tahreem24
Super User
Super User

@Anonymous You want different between weeks as a Day OR difference beween weeks as Opened Hours? PLease also share the expected result which you want.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
johnt75
Super User
Super User

You could create a measure like 

Week on week diff =
VAR thisWeek =
    SELECTEDVALUE ( 'Table'[Week] )
VAR thisWeekValue =
    SELECTEDVALUE ( 'Table'[Average of Rounded Open Hours] )
VAR lastWeekValue =
    LOOKUPVALUE (
        'Table'[Average of Rounded Open Hours],
        'Table'[Week], thisWeek - 7
    )
RETURN
    thisWeekValue - lastWeekValue

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.