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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Connection of Week to Dax calendar week

Hello all,

 

My Data table has
Item, WeekNumber, Year , sales data. 
I want to see YOY growth by Week. 
I tried creating a calendar using Dax . How should I map my calendar table with my data table. 

I tried mapping WeekNumber to WeekNumber, It dint work as I need to map year as well i think,

I tried to create a new column in both tables with Week-Year (1-2020, "W,YYYY" - in text format) and created a connection. Even this dint work.

Can some one help me how to resolve this issue

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous 

The same week is 364 days behind. Make sure you have date calendar in place

Week Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,Day))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

Appreciate your Kudos.

 

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

You cloud refer to this blog:https://www.sqlbi.com/articles/custom-year-over-year-calculation-in-dax/ 

If the problem persists,could you please share sample data and expected output?(Please mask any sensitive data before uploading)

 

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

amitchandak
Super User
Super User

@Anonymous 

The same week is 364 days behind. Make sure you have date calendar in place

Week Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,Day))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

Appreciate your Kudos.

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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