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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
obriaincian
Resolver I
Resolver I

Get what date last Monday was

Is there a simple DAX expression that calculates the start date of the previous week?

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

It is bad practive to use DAX for date intellence.

Use a Calendar table instead.

 

In Power Query
add a start of week column using Date. StartOfWeek

then create a week offset with 0 for this week, -1 for last week, -2 for pervious week

You can then slice and dice by the offset and use it is calculation function.

 

Click here to learn about Power Bi calendars 

all reports use dates, so it is really important that you learn about calendars and offsets

 

Thanks for reaching out for help.

I put in a lot of effort to help you, now please quickly help me by giving kudos.

Remember we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button. 

If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime.  I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me. 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

 

View solution in original post

4 REPLIES 4
Nofil098
Resolver I
Resolver I

Yes, you can use start of week function to get th date for the monday.

v-henryk-mstf
Community Support
Community Support

Hi @obriaincian ,

 

Whether the advice given by @speedramps  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Looking forward to your feedback.


Best Regards,
Henry

speedramps
Super User
Super User

It is bad practive to use DAX for date intellence.

Use a Calendar table instead.

 

In Power Query
add a start of week column using Date. StartOfWeek

then create a week offset with 0 for this week, -1 for last week, -2 for pervious week

You can then slice and dice by the offset and use it is calculation function.

 

Click here to learn about Power Bi calendars 

all reports use dates, so it is really important that you learn about calendars and offsets

 

Thanks for reaching out for help.

I put in a lot of effort to help you, now please quickly help me by giving kudos.

Remember we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button. 

If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime.  I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me. 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

 

mh2587
Super User
Super User

Referring you to this article might help you 
https://bielite.com/blog/week-start-date-power-bi-dax/


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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