Forum Discussion

tc97's avatar
tc97
Frequent Visitor
4 years ago
Solved

Calendar Table - Days from most recent Promo

Hi, 

 

I'm creating an internal sales dashboard. I've created and joined a calendar table (below), and everything works fine to report on standard date periods (Date, Week, Week day, Month, Year)

 

DateDay NameStart of WeekStart of MonthStart of Year
01/01/2020Wednesday30/12/201901/01/202001/01/2020
02/01/2020Thursday30/12/201901/01/202001/01/2020
03/01/2020Friday30/12/201901/01/202001/01/2020
04/01/2020Saturday30/12/201901/01/202001/01/2020
05/01/2020Sunday30/12/201901/01/202001/01/2020
06/01/2020Monday06/01/202001/01/202001/01/2020
07/01/2020Tuesday06/01/202001/01/202001/01/2020
08/01/2020Wednesday06/01/202001/01/202001/01/2020

 

My problem comes when I'm looking at promotion specific data. We run various annual promotions, and the dates for each promo vary each year, so I'd like to add an additional two columns to the calendar table: [Promotion Name] and [Promotion Day]. The promotion information is currently held in another table (example below)

Promotion NameStart DateEnd Date
Promo 101/01/202003/01/2020
Promo 205/01/202010/01/2020

 

To track promotion performance against a previous cycle, I'd like to join the two tables to lookup the active promotion (if applicable) and note how many days into the promotion we are, leaving blank where no promotion was active.

DateDay NameStart of WeekStart of MonthStart of YearPromotion NamePromotion Day
01/01/2020Wednesday30/12/201901/01/202001/01/2020Promo 11
02/01/2020Thursday30/12/201901/01/202001/01/2020Promo 12
03/01/2020Friday30/12/201901/01/202001/01/2020Promo 13
04/01/2020Saturday30/12/201901/01/202001/01/2020  
05/01/2020Sunday30/12/201901/01/202001/01/2020Promo 21
06/01/2020Monday06/01/202001/01/202001/01/2020Promo 22
07/01/2020Tuesday06/01/202001/01/202001/01/2020Promo 23
08/01/2020Wednesday06/01/202001/01/202001/01/2020Promo 24

 

Is this possible within PowerBI? Hoping it's quite straightforward and I've missed something obvious...

 

Thanks in advance!

3 Replies