REMOVEFILTERS 没有达到我在 Power BI 中的预期 [英] REMOVEFILTERS not doing what I expected in Power BI

查看:10
本文介绍了REMOVEFILTERS 没有达到我在 Power BI 中的预期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有以下数据,我正在尝试返回团队数量的 distinctcount,无论过滤到哪些团队,但考虑到应用于客户的过滤器.

Hi I have the following data and am trying to return a distinctcount of the number of Teams irrespective of what teams are filtered to, but taking into account the filters applied to Client.

我正在使用以下 DAX

i'm using the following DAX

Total Team Count = CALCULATE(DISTINCTCOUNT(Sheet1[Team]),REMOVEFILTERS(Sheet1[Team]))

我已将我的数据过滤为 Client = aa 和 bb,所以我期望 Total Team Count = 4 (a, b, c & g)

I've filtered my data to Client = aa and bb so am expecting Total Team Count = 4 (a, b, c & g)

当我过滤到 Team = a 或 b 但是 c &d 返回 团队总数 = 3似乎过滤到 c 会返回 a、b 和c 而 d 返回 a, b, g.因此,它似乎将具有共同 ClientTeams 的不同计数返回给过滤到的 Team.

this works fine when I filter to Team = a or b However c & d return a Total Team Count = 3 it seems filtering to c returns a count of a, b & c whilst d returns a, b, g. So it seems to be returning a distinctcount of the Teams with a common Client to the Team filtered to.

我做错了什么?无论 Team 过滤器如何,如何让它返回 Total Team Count = 4?

What am I doing wrong? How do I get it to return Total Team Count = 4 irrespective of the Team filter?

推荐答案

这是一个自动存在 乱跑.请阅读链接的文章.

This is a case of auto-exist run amok. Please read the linked article.

在您的情况下,当您过滤到团队 c 时,唯一剩下的客户端是 aa,这意味着尽管选择了客户端 bb同样,团队 c 间接过滤了 Client 列,即使您稍后尝试从度量中的团队中删除该过滤器.

In your case, when you filter down to Team c, the only remaining Client is aa, which means despite having Client bb selected too, the Client column has been indirectly filtered out by Team c even though you later try to remove that filter from Team in your measure.

如文章中所述,解决方案是构建一个星型模式,将维度分解到它们自己的表中.

As mentioned in the article, the solution is to build a star schema that breaks out dimensions into their own tables.

这篇关于REMOVEFILTERS 没有达到我在 Power BI 中的预期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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