DAX每月平均成本累计:除以月(表中的行数)

时间:2019-11-26 12:49:48

标签: powerbi dax

我尝试在表格中计算每月的平均费用(AvgCosts)。 我使用了以下措施,但与当前的CostsCumulative列没有区别。

AvgCosts = 
DIVIDE (
    [CumulativeCosts] ,
    ,DISTINCTCOUNT('Calendar'[YearMonthnumber])
)

通过使用该度量获得的结果:

YearMonth   Costs   CostsCumulative AvgCosts
2019/01     100     100             100
2019/02     200     300             300
2019/03     100     400             400
2019/04     200     600             600

我期望的结果:

YearMonth   Costs   CostsCumulative AvgCosts
2019/01     100     100             100
2019/02     200     300             150
2019/03     100     400             133.33
2019/04     200     600             150

我在此报告中使用的唯一过滤器是Calendar,我也在度量中使用了该过滤器。 有什么建议吗?

0 个答案:

没有答案