如何计算powerbi中测量的累积和

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

我有一个日期表和侦察表。在 recon 表中,我有 new_reported_issue(新问题)的度量、未解决问题的度量和已关闭问题的度量以及列名称 recon_date(这将告诉我们问题发生的日期)。 我创建了一个矩阵,在其中我从日期表中的行和值中传递 MonthName,我传递 new_reported 、 issues_open 和 issues_close 。像这样

MonthName   newly_reported   issue_open    issue_closed
January       6                   3             3
February      7                   4             3
March         

现在我想计算未结问题的累积总和,所以我的预期输出是这样的

  MonthName   newly_reported     issue_closed    cumulative_open
    January       10                  7             3             
    February      12                  15            0
    March         14                  12            2           

所以我使用的公式是new_reported - issues_close +前一个的cumulative_open。

如何在powerbi上计算这个?

powerbi dax powerbi-desktop
1个回答
0
投票

我创建了用于计算累积开仓量的度量。

Cumulative_Open = IF(ISBLANK([Newly_Opened]) && ISBLANK([Total_Closed]), BLANK(), CALCULATE([Newly_Opened]-[Total_Closed],
FILTER(ALL('Date'),'Date'[Date] <=  MAX('Date'[Date])
)))
© www.soinside.com 2019 - 2024. All rights reserved.