Forum Discussion
jaryszek
6 years agoSuper User
Changing defaults table based on customizations table and composite keys
Hi Guys, I am using PQ in Excel. i have 2 sources: t_Defaults and t_Customizations with composite Key: Topology&Tier&Function As a base i am using t_Defaults but what i wan...
- 6 years ago
// t_Customizations let Source = Excel.CurrentWorkbook(){[Name="t_Customizations"]}[Content] in Source // output let keys = List.FirstN(Table.ColumnNames(t_Customizations), 3), acc = List.Accumulate( Table.ToRecords(t_Customizations), t_Defaults, (s,c)=>let pos = Table.PositionOf(s, Record.SelectFields(c, keys), 0, keys) in Table.ReplaceRows(s, pos, 1, {c}) ) in acc // t_Defaults let Source = Excel.CurrentWorkbook(){[Name="t_Defaults"]}[Content] in Source
v-juanli-msft
6 years agoCommunity Support
Hi jaryszek
protocol1 =
IF (
RELATED ( t_Customizations1[StorageProtocol] ) <> BLANK (),
RELATED ( t_Customizations1[StorageProtocol] ),
t_Defaults2[StorageProtocol]
)
version1 =
IF (
RELATED ( t_Customizations1[ProtocolVersion] ) <> BLANK (),
RELATED ( t_Customizations1[ProtocolVersion] ),
t_Defaults2[ProtocolVersion]
)
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.