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
apmulhearn
Helper III
Helper III

Compare this week last year data, USING week number but DISPLAYING current week end date or similar

Hello, and many thanks, in advance, for any help possible.

 

 I've been tasked with replicating an Excel report that gets sent out every week

 

The way that it is currently distributed, we review data on a weekly basis, and compare to the same week last year.

The complication (at least, for me) is that what they are REALLY looking at is week numbers (week 1, week 2, etc) but they only want to see it with dates.

 

I've been able to create a week number formula in BI. 

(Mktg Wk No = WEEKNUM('Date Table'[Date],02))

I've been able to create a week end date in BI.

(Mktg Week End date = 'Date Table'[Date]- WEEKDAY('Date Table'[Date],2) +7)

 

What I want is to display on a row the weekend date, then show the performance for that same week number in prior years. 

 

The photo with the handwriting on it is how, ideally, it would look.

The photo below is the workaround I use to find those numbers...but I'm having a hard enough time getting people to try and use BI reports, so I'd like to give them what they want. A small export of the workaround table is also below.

 

The booked guest and bookings figures are joined on the date to a date table from a guest table, and then summarized by week end date.

 

Goal Layout.JPGWorkaround layout.JPG

 

 

Mktg Wk NoMktg Week End date# Booked Guests# BookingsYear

11/5/2020 0:00632020
11/6/2019 0:0043142019
21/10/2021 0:001462021
21/12/2020 0:0058312020
21/13/2019 0:0067212019
31/17/2021 0:0025142021
31/19/2020 0:0063282020
31/20/2019 0:0043202019
41/24/2021 0:0041132021
41/26/2020 0:0056442020
41/27/2019 0:0053232019
51/31/2021 0:001772021
52/2/2020 0:0056312020
52/3/2019 0:0051262019
62/7/2021 0:0047162021
62/9/2020 0:0040172020
62/10/2019 0:0035182019
72/14/2021 0:0020102021
72/16/2020 0:0046292020
72/17/2019 0:0032122019
82/21/2021 0:0016122021
82/23/2020 0:0043302020
82/24/2019 0:0053182019
92/28/2021 0:0029152021
93/1/2020 0:0041252020
93/3/2019 0:0051262019
103/7/2021 0:0031122021
103/8/2020 0:0043152020
103/10/2019 0:0030132019
113/14/2021 0:002852021
113/15/2020 0:0022112020
113/17/2019 0:0040172019
123/21/2021 0:0031102021
123/22/2020 0:00552020
123/24/2019 0:0038172019
4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hi, @apmulhearn 

 

Based on your description, i created data to reproduce your scenario. The pbix file is attached in the end.

Table:

b1.png

 

You may create a matrix visual like below.

b2.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Allan,

 

Thank you so much for taking the time to help me!  For ME, this would be a fine solution. For my end user, I think it will still be visually confusing for two reasons - but maybe those are fixable in a way I'm not thinking of?
1. The YEAR columns would need to sort descending

2.  The Mktg Week End Date would only desirtably display in the most recent column. 

 

I've displayed a crude redline below. Can you tell me if you know a clever way to do this?

Thank you again for your kind help,

 

apmulhearn_0-1617656560483.png

 

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@apmulhearn , Create a date table

Have a new column

 

new columns
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format

 

And create measures
This Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Last year Week= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=(max('Date'[Week Rank]) -52)))

 

Also refer

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

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.