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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Newbie_2020
Frequent Visitor

DAX Weekly YOY

Hello everyone,

I need some help in DAX and I would really really appreciate any inputs.

 

This is my Quotes_Year_Wk table

Year_Week   Quotes

2019-25       13,582

2019-26       13,112

2019-27       12,908

2020-25       20,927

2020-26       21,126

2020-27       26,064

 

I want to calculate weekly YOY for quotes by using Year_Week column

For example, I want to know the YOY change in week 25.

 

From the table above, I want to get

2019-25       13,582

2020-25       20,927

Wk_YOY = 20,927/13,582-1

 

I honestly have a hard time figuring out the correct DAX to get the vakue I needed :'(

 

Thank you so much!

Newbie_2020

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Newbie_2020 , Split year and week .

year = left([Year_Week ],4)

Week  = right([Year_Week ],2)

 

better move week year to a new new table and create these columns there. Join on week year with the original table

 

example

YTD Week = CALCULATE(sum('Table'[Quotes]), FILTER(ALL('Date'),'Date'[Week]<=max('Date'[Week]) && 'Date'[Year]= max('Date'[Year])))
LYD Week = CALCULATE(sum('Table'[Quotes]), FILTER(ALL('Date'),'Date'[Week ]=max('Date'[Week]) && 'Date'[Year]= max('Date'[Year])-1 ))

 

'Date' is new table you have week year

 

very similar approach

Power BI — WTD Questions— Time Intelligence 4–5
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...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Newbie_2020 , Split year and week .

year = left([Year_Week ],4)

Week  = right([Year_Week ],2)

 

better move week year to a new new table and create these columns there. Join on week year with the original table

 

example

YTD Week = CALCULATE(sum('Table'[Quotes]), FILTER(ALL('Date'),'Date'[Week]<=max('Date'[Week]) && 'Date'[Year]= max('Date'[Year])))
LYD Week = CALCULATE(sum('Table'[Quotes]), FILTER(ALL('Date'),'Date'[Week ]=max('Date'[Week]) && 'Date'[Year]= max('Date'[Year])-1 ))

 

'Date' is new table you have week year

 

very similar approach

Power BI — WTD Questions— Time Intelligence 4–5
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...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak  Thank you so much! Let me go ahead and try this.  I really, really appreciate it. 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.