根据月份进行计数
我根据以下公式创建了一种新措施,该方法将根据时期进行累积观察计数。
Measure = CALCULATE (
COUNT ('Test'[Id] ),
FILTER (
ALLSELECTED ( 'Test' ),
'Test'[Period] <= MAX ( 'Test'[Period] )
)
)
我应用的月份具有过滤器,但是我的要求是,如果新的时期开始,则计数应从0而不是先前的值开始。 例如
ID | 期间 | 月 | 1 |
---|---|---|---|
2022-02 | 2022-01-30 | 2022-01 | 1 |
2 | 2022-01-31 | 2022-01 | 2 |
3 | 2022-02-02-01 | : | 1 |
4 | 2022-02-02-02-01 | 2022-02 | 2 |
2022-01 一个示例(我创建了一个度量而不是列)。有什么办法可以实现这一目标?
I have created a new measure based on below formula which will do a Cumulative count of observation based on Period.
Measure = CALCULATE (
COUNT ('Test'[Id] ),
FILTER (
ALLSELECTED ( 'Test' ),
'Test'[Period] <= MAX ( 'Test'[Period] )
)
)
I have applied Month has filter however my requirement is that if a new period start then count should start from 0 instead of previous value.
Eg:
Id | Period | Month | temp |
---|---|---|---|
1 | 2022-01-30 | 2022-01 | 1 |
2 | 2022-01-31 | 2022-01 | 2 |
3 | 2022-02-01 | 2022-02 | 1 |
4 | 2022-02-01 | 2022-02 | 2 |
Here temp is basically an example(I have created a Measure and not column). Is there any way I can achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论