如何在Power Bi上获取周三到周四的每月周数?

问题描述 投票:0回答:1

我正在尝试计算每月的周数:星期四 - 星期三

我正在计算接下来的 4 周:

Week 1: Thursday: October 3 - Wednesday: October 9
Week 2: Thursday: October 10 - Wednesday: October 16
Week 3: Thursday: October 17 - Wednesday: October 23
Week 4: Thursday: October 24 - Wednesday: October 30

我使用的公式仅计算周日至周六

=
1 + WEEKNUM( 'ECR'[Date Originated] )
    - WEEKNUM( EOMONTH( 'ECR'[Date Originated], -1 ) + 1 )

如何调整此公式以适应正确的日期? 是否有不同的公式可以用来计算从星期四到星期三而不是星期日到星期六的周数?

excel powerbi dax
1个回答
0
投票

尝试将起始日期更改为周四开始一周:

= 1 + WEEKNUM( 'ECR'[Date Originated] - 3 ) 
    - WEEKNUM( EOMONTH( 'ECR'[Date Originated], -1 ) - 2 )
© www.soinside.com 2019 - 2024. All rights reserved.