cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Previous Week DAX

Hello everyone, hope you're doing well.

I have an issue regarding Previous Week calculation using DAX. I have sales table that is represented in the weekly basis. How can I calculate the Previous Week Sales since it's more challenging using Standard Date Table?
The purpose of why I want to calculate the previous week is to be a baseline to calculate Current Week vs Previous Week Sales, Current Week vs Same Week in the last month.

Please kindly find the attached link into the PBIX file. Really appreciate your help and support. Thank You!

1 ACCEPTED SOLUTION
Super User

Hi,

Not sure what you want the answer to be but i get 6000 with this edited measure

``Total Sales Last Week = CALCULATE([Total Sales],DATESBETWEEN('Calendar'[Date],MAX('Calendar'[Date])-6,MAX('Calendar'[Date])))``

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
4 REPLIES 4
Frequent Visitor

Hi Ashish, Thanks for replying! The questions are:
1) How to show the value of last week? since in the PBIX file, specifically in the Card Visual, the previous week sales is a cumulative of previous week in March
2) How can I calculate the Current Week vs Same Week in the Last Month?

Thank you!

Super User

Hi,

Not sure what you want the answer to be but i get 6000 with this edited measure

``Total Sales Last Week = CALCULATE([Total Sales],DATESBETWEEN('Calendar'[Date],MAX('Calendar'[Date])-6,MAX('Calendar'[Date])))``

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Frequent Visitor

Hi Ashish, thanks for your reply! Let me try and back to you as soon as possible. Thank you

Super User

Hi,

What problem are you facing there?  You have already writtten the formula.

Regards,
Ashish Mathur
http://www.ashishmathur.com

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors