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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
CosminB
Regular Visitor

Calculate custom week number

Hi all,

 

I'm trying to create a custom week number (period week) using ideally import date (A) or import week (B).

The numeration of period week should be calculated based on the custom Start date and End date. These two columns are not available in my data model.

 

CosminB_1-1661935850581.png

 

In quarter info I have only the start date of the week 1 and the end date which correspond with week 6.

CosminB_2-1661936287341.png

 

= Table.AddColumn(#"Expanded quarter_info", "Period Week", each Text.Start([Quarter],4) & " wk" & Number.ToText(Date.WeekOfYear([Import Date]) - Date.WeekOfYear([quarter_info.Start Date) + 1))

 

This code it's calculating the end of week 1 on Friday and the start of the week 2 on Monday:

 

CosminB_3-1661936749657.png

 

I tried also to create in the datamodel a table with the dates for each week (week 1 - week 6) but it's affecting the values displayed on every visual (there are sales numbers).

 

Any suggestion will be appreciated.

 

Thanks

 

 

1 REPLY 1
Anonymous
Not applicable

Hi @CosminB ,

 

I'm sorry I didn't understand what you meant. Can you provide relevant example data or a pbix file without private data and show the expected results you want to accomplish?
I apologize that I did not succeed in understanding your request and would appreciate it if you could explain it clearly for me.

 

Best regards,

Community Support Team Selina zhu

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

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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