我有一个powerbi模型来分析一个调查的结果。
我有以下计算方法:
[distinctcount of respondents this year] = DISTINCTCOUNT('Fact NRPS'[Serial])
[distinctcount of respondents last year] = CALCULATE('Fact NRPS'[Responders], SAMEPERIODLASTYEAR('Dim Dates'[Date]))
[year on year difference] = [distinctcount of respondents this year] - [distinctcount of respondents last year]
在报告中,我总结了[Question]的这些措施。因此,我有一份报告,其中列有这样的栏:
[Question],[distinctcount of respondents this year],[distinctcount of respondents last year],[year on year difference]
现在,我想在这份报告的底部添加一个总结行,显示[year on year difference]大于零和[year on year difference]小于零的问题的数量。
因此,它会告诉我们大约45个问题比去年有更多的受访者,而21个问题的受访者较少。
我怎么能在DAX里这么做?
[year on year difference]大于零的问题数。然而,这是行不通的。因为概括地说,它不允许我使用另一个计算的度量,即[year on year difference]。If([year on year difference]>0,1,0) ),然后向报表中添加一个总计行,则这也不起作用。在这种情况下,它将计算出的度量值显示为1或0。关于我该怎么做有什么想法吗?
谢谢
梅梅特
发布于 2017-05-16 16:39:41
像这样的事情应该有效:
Measure = CALCULATE(COUNT([Column]),
FILTER(Table, [Year]=2017)) - CALCULATE(COUNT([Column]),
FILTER(Table, [Year]=2016))https://stackoverflow.com/questions/38307733
复制相似问题