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
477885wk
New Member

Compare sales over past years with dynamic holiday week adjustment

I want to compare sales over the past few years. I want to show daily sales based on week number. So a line that represents the current year; week 27, week 28(current), week 29. Another line representing the same weeks for 2018. As time passes and I refresh, the weeks change. But here is the tricky part, some holidays do not occur on the same date every year. So when a holiday is occuring, I need to show the corresponding past week. So 2019 line would show holiday -1(week27), holiday (week 28), holiday +1 (week29). And the 2018 line would adjust and show, holiday -1(week26), holiday (week 27), holiday +1 (week28). Or whatever week it occured. It must be matched properly. Also a regular week in 2019 might have been a holiday in 2018. 

Thank you!

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@477885wk ,

 

You need to import a holiday table from website(The table should contains date and day number in a week) and then build a relationship between the holiday table and original table. Then you can create a calculate column/measure to mark the workdays and other days. For more details, you can refer to similar case below:

https://community.powerbi.com/t5/Desktop/Public-Holiday-Script/td-p/178341

 

You can also refer to the third-party blog below:

https://www.andredevelopment.com/en-US/community/blogs/powerbi/working-days-holidays-calendar/

 

Community Support Team _ Jimmy Tao

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

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@477885wk ,

 

You need to import a holiday table from website(The table should contains date and day number in a week) and then build a relationship between the holiday table and original table. Then you can create a calculate column/measure to mark the workdays and other days. For more details, you can refer to similar case below:

https://community.powerbi.com/t5/Desktop/Public-Holiday-Script/td-p/178341

 

You can also refer to the third-party blog below:

https://www.andredevelopment.com/en-US/community/blogs/powerbi/working-days-holidays-calendar/

 

Community Support Team _ Jimmy Tao

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

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.