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
SiGill1979
Frequent Visitor

Weeks overlapping Years

We have suppliers who's seasons over lap years. For instance they start supplying us in Week 42 and end supply in week 7.
I need to write something in Power Query that will get me the year for these weeks.

In this example week 42 is in 2022. So the start year is 2022. How can I write it so that it gives me 2022 as the year for Weeks 42-52 and 2023 for weeks 1-7.

I did write:

if [Week]<42 then 2023 else 2022

but it could be different weeks for different suppliers.

Can anyone help at all?

1 REPLY 1
ams1
Responsive Resident
Responsive Resident

Hi,

 

Any chances you can provide how the table where you want to add that formula looks like?

 

Like this?

 

ams1_0-1675938506220.png

 

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.

Top Solution Authors