Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
How to merge such two tables:
to get such a result (value is divided by shares and bonds percentage)?
pbix is here if needed.
Solved! Go to Solution.
Hi pls try this code
let
Source = #"funds structure",
#"Replaced Value" = Table.ReplaceValue(Source,null,0,Replacer.ReplaceValue,{"shares", "bonds"}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Replaced Value", {"funds"}, "Attribute", "Value"),
#"Merged Queries" = Table.NestedJoin(#"Unpivoted Other Columns", {"funds"}, #"funds value", {"funds"}, "funds value", JoinKind.LeftOuter),
#"Expanded funds value" = Table.ExpandTableColumn(#"Merged Queries", "funds value", {"value"}, {"value.1"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded funds value",{{"value.1", type number}}),
#"Added Custom" = Table.AddColumn(#"Changed Type1", "NewValue", each [Value]*[value.1]),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Value", "value.1"})
in
#"Removed Columns"
| User | Count |
|---|---|
| 22 | |
| 20 | |
| 19 | |
| 19 | |
| 11 |
| User | Count |
|---|---|
| 62 | |
| 54 | |
| 46 | |
| 44 | |
| 32 |