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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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