简体   繁体   English

前几个月的 Power BI 累计和

[英]Power BI Cumulative Sum for Previous Months

I have the following dataset:我有以下数据集:

在此处输入图像描述

I have created the following measure:我创建了以下度量:

NumStdReqCreatedByMonth = COUNTX(StdReq;StdReq[Created].[Month])

using measue I have the following table:使用 measue 我有下表:
在此处输入图像描述

I want the following:我想要以下内容:

在此处输入图像描述

sum of tickets created in previous months.前几个月创建的工单总和。

Do you know how to do it?你知道怎么做吗?

Thanks.谢谢。

I think this is what you are looking for.我想这就是你要找的。

Backlog =
CALCULATE(
    [NumStdReqCreatedByMonth],
    FILTER(
        ALLSELECTED( 'Calendar' ),
        'Calendar'[Date] < MIN( StdReq[Created] )
    )
)

Assuming there is a Calendar dimension table which has one-to-many relationship with StdReq table, this calculates the number of tickets created before the earliest date in selected period.假设有一个与 StdReq 表具有一对多关系的 Calendar 维度表,这将计算在选定期间的最早日期之前创建的工单数量。 If selected period is November 2019, then it counts the tickets created by October 31, 2019.如果选择的时间段是 2019 年 11 月,则计算 2019 年 10 月 31 日之前创建的工单。

I have managed to calculate the backlog of one month:我设法计算了一个月的积压:

    BackLogNovember = CALCULATE(
[NumStdReqCreatedByMonth];
FILTER(
    ALLSELECTED( StdReq );
    StdReq[Created] < Date(2019;11;01) 
)

) )

is it possible to iterate this function for each month and generate a table?是否可以每月迭代这个 function 并生成一个表?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM