【问题标题】:Creating Hierarchy Parent has Same Child as Another创建层次结构父具有与另一个相同的子
【发布时间】:2019-08-07 20:35:25
【问题描述】:

我在 power bi 中创建层次结构并遇到错误“'Master'[ChildID] 中的每个值必须在 'Master'[ParentID] 中具有相同的值。值 'Drawing 1' 有多个值”尝试使用下表创建路径时。

Data Table

Error Message

据我了解,层次结构中不能有不同的父级和同一个子级,因为在第二级,它不知道指向哪个父级。有没有办法创建允许我创建的数据树/路径?我还附上了我要创建的树的图表。

Desired Hierarchy

【问题讨论】:

标签: sql powerbi dax powerquery powerbi-desktop


【解决方案1】:

您的数据表设计不适合此层次结构。您要么构建一个查询来获取此设计,要么更改您的数据表。这就是您的表格的外观:

Material       Drawing         MWR
 Mat1           Draw1          Mwr1
 Mat1           Draw2          Mwr1
 Mat2           Draw4          Mwr1
 Mat2           Draw3          Mwr7
 Mat1           Draw1          Mwr5
 Mat1           Draw3          Mwr2
 Mat2           Draw4          Mwr6
 Mat2           Draw3          Mwr6

如果您有这样的数据,您只需将Drawing 拖放到MaterialMWR 并拖放到Material(就在最后一个位置)即可层次结构。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-27
    • 1970-01-01
    • 1970-01-01
    • 2017-03-12
    相关资源
    最近更新 更多