来自用电源查询创建的数据模型的表之间的电源枢轴关系

发布于 2025-02-10 20:26:39 字数 1433 浏览 1 评论 0原文

我在表之间进行了一个关系1,但是当我尝试在枢轴表中使用它时,它会失败。我收到通常的黄色消息,说它可能缺乏关系。当我让它试图检测一个时,它找不到任何可能的东西,当我检查现有的东西时,我的就在那里并正确地完成了。

这是对情况的模型:

这些是简单的表:

要将值发送到数据模型,我使这些表可以通过电源查询,因为实际情况需要电源查询。没有添加其他步骤,只是“从表格或范围”来源。

然后,在Power Pivot中,我创建了图表视图的关系:

然后创建一个枢轴表时,关系不会影响:

我还尝试添加一个措施并将其用作值,但无济于事:

Price:=SUMX(Rqt_Ref;Rqt_Ref[C_B]*Rqt_Ref[C_C])

我没有用原始表来创建枢轴表即使有超过1 048 576行,我也希望它能起作用。

我不知道为什么会失败,我欢迎任何评论。

编辑:由于我不想使用DAX(相关)在Power Pivot中完成工作

I made a relation 1 to many between to table but when I try to use it in a pivot table it fails. I get the usual yellow message saying it may lack a relation. When I let it try to detect one it fails to find anything possible and when I check the existing ones, mine is there and done properly.

Here is a mock-up of the situation :

These are the simple tables :
enter image description here

To send the values to the data model I make those tables go through Power Query because the real situation requires Power Query. No additional steps are added, it's just the "From table or range" source.

Then, in Power Pivot, I create the relation with the diagram view :
enter image description here

When I then create a pivot table, the relation has not impact :
enter image description here

I also tried to add a measure and use it at as the value but to no avail :

Price:=SUMX(Rqt_Ref;Rqt_Ref[C_B]*Rqt_Ref[C_C])

I did not create the pivot table with the original tables instead of the one that were send to the date model because I want this to work even if there are more than 1 048 576 rows.

I have no idea as for why it fails and I welcome any comment.

Edit : Since I don't want to do the job in Power Pivot with DAX (related) I did the merge with Power Query Merge queries :
enter image description here
enter image description here
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瀟灑尐姊 2025-02-17 20:26:39

我认为您可能会误解PowerPivot的工作原理。您的模型应与C_A和C_4有关。

当我从维度(C_A)中添加字段,然后从事实C_4添加一个字段时,它将显示所有内容的交叉接口,并且似乎无法正常工作。 excel这样做,直到您在值中很好地放置值。

一旦我像以下那样将井中的计数放在井中,这种关系正常。


您可能会感到困惑的地方是,如果您将字段从RQT_REF放到值中,然后将一个错误再次获得此错误并完整的交叉加入。这样做的原因是,您要求Power Pivot从维度到事实(确定),但从事实到维度(不正常)

I think you might be misunderstanding how PowerPivot works. Your model should be related on C_A and C_4 for a start.

enter image description here

When I add fields from the dimension (C_A) and then one from fact C_4, it will show a cross join of everything and appear not to be working. Excel does this until you place a value in the values well.

enter image description here

Once I drop a count in the well like follows, the relationship works fine.

enter image description here
enter image description here

Where you might be getting confused is if you drop a field from Rqt_Ref into the values well and then you will get this error again and a full cross join. The reason for this is that you are asking Power Pivot to go from dimension to fact (OK) but then from fact to dimension (not OK)
enter image description here
enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文