数据映射/融入电力BI

问题描述 投票:0回答:1

我有桌子 enter image description here

我想要这样的数据

属性值 301 10岁以下, 10 - 12 , 12 -13 第401章…………

只有前三位是属性,例如 301 和相同的属性,例如 301,3011,3012 与它们的值一起映射。 同样,401 的值为 401,4012,4014,...

powerbi dax powerquery
1个回答
0
投票
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Attribute", Int64.Type}, {"Value", type text}}),
Trim = Table.TransformColumns(#"Changed Type",{{"Attribute", each Text.Start(Text.From(_),3), type text}}),
#"Grouped Rows" = Table.Group(Trim, {"Attribute"}, {{"Value", each Text.Combine([Value],"//")}})
in  #"Grouped Rows"

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.