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
flex99
Helper I
Helper I

relative date show second next week only

Hi,

 

I want to create a week schedule showing the last, current, next and second next week on a single report each.

I know how to filter for relative dates, but the only option is to choose "element within next 2 calendar weeks".

Is there a way to filter for the data of the week after the next week (as from today: show only CW 17)?

 

Thanks in advance!

1 ACCEPTED SOLUTION

I just wanna let you know that I found the following M Code in Power Query to be working perfectly for creating a relative week number which can be used as a filter:

 

Relative Week = (Number.From(Date.StartOfWeek([Date]))-Number.From(Date.StartOfWeek(DateTime.LocalNow())))/7

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@flex99 

You can do with the help week rank. Refer to my file to see how week Rank can help you

https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0

Wow, that's already quite helpful. Can you help me in creating a week rank that applies always to today's date? My goal is to set a filter "week rank = 2" to always show the data of the second next week based on today's date. Thus it would by dynamic and without creating a measure for the shown data.

 

I tried to use

Week Rank = RANKX(all(Table);TODAY();;ASC;Dense)
but as it only shows "1" for every week, it seems I don't get the logic behind your approach.
 
Thanks for your support!

I just wanna let you know that I found the following M Code in Power Query to be working perfectly for creating a relative week number which can be used as a filter:

 

Relative Week = (Number.From(Date.StartOfWeek([Date]))-Number.From(Date.StartOfWeek(DateTime.LocalNow())))/7

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.