Power BI中的移动平均线

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

我有一个数据集,如果答案是否有用,日常用户可以从论坛回答问题。

所以我计算:

- a measure that calculate the total answer by yes: answerYes
- a measure that calculate the total answer (yes or no): answerTot
- a measure that calculate the ratio: answerPercYes= DIVIDE(answerYes,answerTot)

我需要的是在7天内计算我日期维度(answerDate)的移动平均线。我怎样才能在PowerBI中实现这一目标?

非常感谢!

statistics powerbi dax
1个回答
1
投票

你可以尝试这样的事情:

movingAverage:=
    CALCULATE(
        [answerPercYes]
       ,DATESINPERIOD(
          'answerDate'[Date]
          ,max('answerDate'[Date])
          ,-7
          ,DAY
        )
     )
© www.soinside.com 2019 - 2024. All rights reserved.