REMOVEFILTERS没有按照我在Power BI中的预期进行操作 [英] REMOVEFILTERS not doing what I expected in Power BI

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

问题描述

我有以下数据,并且无论是否过滤了哪些团队,我都在尝试返回不同数量的团队数量,但要考虑到应用于客户端的过滤器.

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]))

我已将数据过滤到客户 = aa和bb,因此我期望团队总数 = 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.因此,似乎返回了具有常见 Client 的不同数量的 Team 到过滤后的 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 过滤条件如何,如何返回团队总数 = 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 也会间接过滤掉客户"列.

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天全站免登陆