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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Changing the Date Week over Week - Visual Representing

Hi,

 

This is the scenario. I have already created a report and published on PowerBi. This looked to me like a simple requirement but was wondering how to do it.

 

1. Every week there is a Change Management Data thats published to the top management. This has various analysis etc.but what I am bothered about here is the heading.

 

Basically whenever the report is sent in the Subject Line in the email the team mentions it like Changes for this Week (24th MAY '21 - 30th MAY '21) and same goes on for the upcoming weeks. So what I want is to include a similar one in PowerBi report where for the current week the Header or title shows as Changes for this Week (24th MAY '21 - 30th MAY '21) and for the next week it would should switch to  Changes for this Week (1st June 2021 - 7th June 2021) so basically I want the Title to change when the week changes. Is this possible?

 

Let me know if this is not clear/

1 ACCEPTED SOLUTION

@Anonymous 

I added a variable so you can assign any date that you have from your model, may be the last date of the transactions. I just added today()-7 so it will always show the previous week.

 

Week Range = 

var _date = TODAY() -7
return
    FORMAT( _date- WEEKDAY(_date,2) + 1 , "Dd-Mmm-Yy") & " - " &  
    FORMAT( _date - WEEKDAY(_date,2) + 7 , "Dd-Mmm-Yy") 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

7 REPLIES 7
Fowmy
Super User
Super User

@Anonymous 

Please clarify if what is your week base. is it Monday to Sunday regardless of Month and Year or Is it Month based?
As per your example 31st May is skipped and you start from 1st June.

Would it be 
24th MAY '21 - 30th MAY '21
31st June '21 - 6th June '21


Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thats right its Monday to Sunday Regardless of the Month and Year.

 

But can it be done? This is just a dynamic visual representation im looking at

@Anonymous 

Use this measure to get the week range for the selected date, I used today as the date.

Week Range = 

FORMAT( TODAY() - WEEKDAY(TODAY(),2) + 1 , "Dd-Mmm-Yy") & " - " &  
FORMAT( TODAY() - WEEKDAY(TODAY(),2) + 7 , "Dd-Mmm-Yy") 

Fowmy_0-1622468684595.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

This looks great. 

 

Currently on my dashboard the data is of Last 1 week which is from 5/24/21 to 5/30/21 and based on the measure its picking up for Today() how can I change that? but the following up the Image that your showing looks correct. 

 

So basically this week we show that Last Week these were the Changes.

@Anonymous 

I added a variable so you can assign any date that you have from your model, may be the last date of the transactions. I just added today()-7 so it will always show the previous week.

 

Week Range = 

var _date = TODAY() -7
return
    FORMAT( _date- WEEKDAY(_date,2) + 1 , "Dd-Mmm-Yy") & " - " &  
    FORMAT( _date - WEEKDAY(_date,2) + 7 , "Dd-Mmm-Yy") 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Hi,

 

Did you get a chance to check on my query?

 

Since I was stuck, I started a seperate discussion thread which explains the situation in detail. Let me know. I know Im close to the solution just some query issues here and there.

 

https://community.powerbi.com/t5/Desktop/Need-help-in-Date-Please-HELP/m-p/1887982#M724943

Anonymous
Not applicable

change.JPG

 

As per the above image whatever you mentioned works perfectly fine. But, when I try to do an edit interactions say I change the Start Date for Last 2 weeks and End Date to Last 2 weeks. it still shows the same date range. Any changes that we need to the formula? or is my logic incorrect. The current Week Range measure we created is based on a new Date column which I created from the Start Date and the interactions should happen when I change to Start date and End Date filters I choose.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.