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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Hougaard77
Regular Visitor

WeekNum fails with week starting on Monday, but not Sunday

Hi,

 

I have a calculated column in my report called ReportWeek.

 

It is defined as ReportWeek = WEEKNUM(NewData[ReportTime];1)

 

That works great, but if I change the number 1 to 2 like this, it fails:

 

ReportWeek = WEEKNUM(NewData[ReportTime];2)

 

The error is: Function 'WEEKNUM' is not allowed as part of calculated column DAX expressions on DirectQuery models.

 

How does that make sense and what can I do to make it work?

 

Best regards,

 

Erik

1 ACCEPTED SOLUTION
v-haibl-msft
Microsoft Employee
Microsoft Employee

@Hougaard77

 

I’ve got response from the Product Team.

 

In DirectQuery mode, DAX formulas of calculated columns are limited to those which can be translated to SQL in an efficient matter. While it is possible to do so for WEEKNUM when return_type is set to 1, we haven't found an equivalent translation when return_type is 2. So this is a by design behavior of the product.

 

Best Regards,
Herbert

View solution in original post

2 REPLIES 2
v-haibl-msft
Microsoft Employee
Microsoft Employee

@Hougaard77

 

I’ve got response from the Product Team.

 

In DirectQuery mode, DAX formulas of calculated columns are limited to those which can be translated to SQL in an efficient matter. While it is possible to do so for WEEKNUM when return_type is set to 1, we haven't found an equivalent translation when return_type is 2. So this is a by design behavior of the product.

 

Best Regards,
Herbert

v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Hougaard77,

I can reproduce your scenario and I have reported internally. I will post the update if there is any response.

Best Regards,
Angelia

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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
Top Kudoed Authors