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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Last week data to display in power bi

Hi Folks, I have date column in my report based on date column when user selecting any date i want to display  last Monday date on  my report. Can you please help me on DAX. For example today is 23rd nov tuesday when user selecting on 23/11/2021 Tuesday i want to get date last monday(15/11/2021) same as for all. When ever user selecting any date date on middle of day i want to display always last monday.

 

1 ACCEPTED SOLUTION
PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous 

Here's a measure to get you previous monday

Last Monday = 
VAR _SelectedDate = SELECTEDVALUE('Date'[Date]) 
VAR _Result = _SelectedDate - 7 - WEEKDAY(_SelectedDate, 3)
RETURN
    _Result

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

If your problem has been solved, you could accept the helpful answer as solution. 

It will help other community members easily find the solution when they get the similar issue.

If you still need help, please share more details.

 

Best Regards,
Community Support Team _ Eason

PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous 

Here's a measure to get you previous monday

Last Monday = 
VAR _SelectedDate = SELECTEDVALUE('Date'[Date]) 
VAR _Result = _SelectedDate - 7 - WEEKDAY(_SelectedDate, 3)
RETURN
    _Result

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors