Power BI 101- 向表格可视化添加度量会导致“重复”的行。

huangapple go评论76阅读模式
英文:

Power BI 101- Adding a measure to a table visual causes "duplicated" rows

问题

我猜这是一个非常基本的Power BI问题,但在网上花了几个小时后,我仍然没能理解这个问题。

我的数据模型非常简单:
Power BI 101- 向表格可视化添加度量会导致“重复”的行。

并且有两个计算得出的度量,分别统计每个表中国家的不同计数:

国家(地理)= DISTINCTCOUNT(Geo[Country])

国家(销售)= DISTINCTCOUNT(Sales[Country])

所有的数据都在以下表格中可视化:
Power BI 101- 向表格可视化添加度量会导致“重复”的行。

我不明白的问题是,在表格3中,一旦我添加了# 国家(地理)度量,可视化就开始重复显示每个销售表中的国家,与地理表中的所有国家匹配。

我知道如果在该度量中使用交叉过滤器,它是如何工作的,但我不太理解为什么?

请问有人能解释一下Power BI在这里实际上在做什么,或者指引我阅读一些处理这个概念的文档/文章吗?

英文:

I guess this is a very basic power bi question but after spending some hours on the internet still haven't wrapped my head around this.

I have the most simple data model ever:
Power BI 101- 向表格可视化添加度量会导致“重复”的行。

and two calculated measures that count the distinct count of countries in each table:

Country (Geo) = DISTINCTCOUNT(Geo[Country])

Country (Sales) = DISTINCTCOUNT(Sales[Country])

everything is visualized in the following tables:
Power BI 101- 向表格可视化添加度量会导致“重复”的行。

What I'm struggling to understand is why in table 3, as soon as I add the # Countries(Geo) measure,
the visual starts repeating the rows matching each country from the Sales table to all countries in the Geography table.

I know it works if I use a crossfilter in that measure but I dont reallly understand why?

Could someone please explain what power bi is actually doing here or maybe point me to some documentation/article that deals with this concept?

This is a conceptual problem

答案1

得分: 1

这是一个令人沮丧且文档记录不够完善的特性。

造成这种情况的原因解释涉及到一个被称为'auto-exist'的特性。我没有时间也不具备详细描述这个术语的知识(如果你有兴趣,可以参考这里),简单来说,只有当来自同一张表的列被用作过滤器时,这个特性才会应用:如果来自其他表的列正在过滤结果,就像在你的情况下一样,那么'auto-exist'不会应用,正如你在示例中所见,而是会使用交叉连接操作

我记得一段时间前为这种情况开发了一个解决方法。如果我找到了,我会在这个帖子中添加。

英文:

It's a frustrating and not particularly well documented feature.

The explanation as to why this occurs revolves around a feature know as 'auto-exist'. I have neither the time nor the knowledge to give a detailed description of that term (see here, for example, if interested), suffice to sat that this feature only applies if columns from the same table are being used as filters: if columns from other tables are filtering the results, as in your case, then auto-exist does not apply, and, as you are witnessing in your example, a cross-join operation is instead employed.

I recall developing a workaround some time ago for such cases. If I manage to locate it I will add to this post.

huangapple
  • 本文由 发表于 2023年3月31日 20:35:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/75898590.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定