Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Statistics PowerBI中的移动平均_Statistics_Powerbi_Dax - Fatal编程技术网

Statistics PowerBI中的移动平均

Statistics PowerBI中的移动平均,statistics,powerbi,dax,Statistics,Powerbi,Dax,我有一个数据集,每天的用户都会在论坛上回答问题,答案是否有用 所以我计算: - 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) 我

我有一个数据集,每天的用户都会在论坛上回答问题,答案是否有用

所以我计算:

- 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中实现这一点


非常感谢

您可以尝试以下方法:

movingAverage:=
    CALCULATE(
        [answerPercYes]
       ,DATESINPERIOD(
          'answerDate'[Date]
          ,max('answerDate'[Date])
          ,-7
          ,DAY
        )
     )

您能否提供一个示例数据集和预期结果?