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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Milozebre
Helper V
Helper V

Week Number is INCORRECT

Good morning Community, 

 

I have a problem with the week numbers.

As you see, I see some measure for week 44 and we are in week 33.

 

SQL : 

,datepart(ww,A.D_CLOTTECH) AS WEEK_CLOTTECH 

 

I choose the right year but the problem still present.

semaine.png

 

 

 

 

 

 

 

 

 

 

 

 

 

Did you have any idea ? 

 

thank you 

 

 

 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Hello Lydia, 

 

Sorry for the delay.

I found the solution.

 

here is the line in my query for the weeknumber : 

,datepart(ww,A.D_CLOTTECH) AS WEEK_CLOTTECH

 

I look in internet and i found some solution and the easyer is change something in my query : change ww to ISO_WEEK

,datepart(ISO_WEEK,A.D_CLOTTECH) AS WEEK_CLOTTECH

 

Now, its working 🙂 

 

Thank you 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

@Milozebre,

How do you create the measure? Could you please share sample data of your table? And create the following columns in your table and check which formula returns correct result.

WeekNumber = WEEKNUM(Table[A.D_CLOTTECH],1)
WeekNumber = WEEKNUM(Table[A.D_CLOTTECH],2)

Regards,
Lydia

Good Morning Lydia, 

 

I dont create a measure for to get a weeknumber.

its defined in the SQL query.

Here is a view of the result.

 

Weeks.png

 

Thnak you 

Anonymous
Not applicable

@Milozebre,

Do you mean that you get different weeknumber after you import the table to Power BI Desktop by writing SQL query? If so, I am unable to reproduce the issue. Please share me the DDL and DML of your table so that I can test.

1.JPG

Regards,
Lydia

Hi Lydia, 

 

thank you for your answers.

Yes, when I run the query, I get several fields then when I use visualization I see that difference. 

I dont know how to give you DDL and DML, sorry.

The database is very big, I can you the export of the query in excel, if you want ?

 

 

Anonymous
Not applicable

@Milozebre,

Please share me the exported excel file and explain that what fields you use to create the visual.

Regards,
Lydia

Hello Lydia, 

 

Sorry for the delay.

I found the solution.

 

here is the line in my query for the weeknumber : 

,datepart(ww,A.D_CLOTTECH) AS WEEK_CLOTTECH

 

I look in internet and i found some solution and the easyer is change something in my query : change ww to ISO_WEEK

,datepart(ISO_WEEK,A.D_CLOTTECH) AS WEEK_CLOTTECH

 

Now, its working 🙂 

 

Thank you 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.