DAX计算每月平均值(DAX Calculate Monthly Average)
我试图创建一个度量来计算每15分钟收集一组数据的月平均值。 我对DAX更新,并且只是不确定如何在月份ID#中进行智能过滤而无需硬设置。 我尝试的公式是:
平均每月使用量:= AVERAGEX(VALUES('林肯数据'[月]),[kWh])
千瓦时是衡量一列中总使用量的指标
提前致谢
DVDV
I am trying to create a measure to calculate a monthly average from a set of data that was collected every 15 minutes. I am newer to DAX and am just unsure how to intelligently filter by month without hard setting in the month ID #. The formula I am trying is:
Average Monthly Use:=AVERAGEX(VALUES('Lincoln Data'[Month]),[kWh])
Where kWh is a measure of the total usage in a column
Thanks in advance
DVDV
原文:https://stackoverflow.com/questions/48795914
2019-12-20 10:17
满意答案
要获得每月平均使用量,您需要总结每个用户的总使用量并除以该用户的总月数。
在不知道你的桌子是什么样的情况下,很难给出一个很好的公式,但你的测量可能看起来像这样:
= DIVIDE(SUMX(DataTable, [kWh]), DISTINCTCOUNT(DataTable[Year-Month]))
To get the monthly average usage, You need to sum up the total usage per user and divide by the total number of months for that user.
Without knowing what your tables look like, it's hard to give a very good formula, but your measure might look something like this:
= DIVIDE(SUMX(DataTable, [kWh]), DISTINCTCOUNT(DataTable[Year-Month]))
相关问答
尝试这个: SELECT Location,
Avg(value),
month(date)