我有一个数据集,如果答案是否有用,日常用户可以从论坛回答问题。
所以我计算:
- 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中实现这一目标?
非常感谢!
答案 0 :(得分:1)
您可以尝试这样的事情:
movingAverage:=
CALCULATE(
[answerPercYes]
,DATESINPERIOD(
'answerDate'[Date]
,max('answerDate'[Date])
,-7
,DAY
)
)