DAX平均发行 [英] DAX Average Issue

查看:74
本文介绍了DAX平均发行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有此表

I have this table

这是我必须计算平均值的度量值

and this is the measurement i have to calculate the average

交易合同(MTD):= TOTALMTD(SUM([交易合同]),'TestTable'([交易日期]))

Traded Contract(MTD) := TOTALMTD(SUM([Traded Contract]), 'TestTable'([Trading Date]))

平均值:= [交易合同(MTD)] / SUM([交易日])

Average := [Traded Contract(MTD)]/SUM([Trading Days])

当前平均值的结果在每日水平上是正确的,
当我希望查看每月平均值时,我没有按日期进行筛选,那么我将得到结果9000/14 = 642,这是不正确的,我希望看到4425,这是每个平均值的总和。如何修改平均测量查询以获取预期结果

Currently the result of average is correct up to daily level, When I wish to see the monthly average, I didn’t filter by date, then I will get the result 9000/14 = 642 which is incorrect, I wish to see 4425 which is the total of each average. How do I amend my Average measurement query to get the expected result

推荐答案

我不确定您为什么要这样做因为4425并不是真正的平均值,但是您可以将公式编写如下:

I'm not entirely sure why you would want to do this since 4425 isn't really an average, but you can write your formula as follows:

Average = SUMX(VALUES(TestTable[Trading Date]),
               [Traded Contract(MTD)] /
               LOOKUPVALUE(TestTable[Trading Days],
                           TestTable[Trading Date],[Trading Date]))

有关此类措施的工作方式的更多信息,建议阅读以下文章:
正确加起来的小计和总计a>

For more information on how these sort of measures work, I suggest reading the following article: Subtotals and Grand Totals That Add Up "Correctly"

这篇关于DAX平均发行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆