Forum Discussion
Anonymous
6 years agoNot applicable
Conditional Join on "Line Name" and Data Range
Hello: I am trying to join two tables by "Line Name" with table one filtering the data in table two by date range such that table table two to only show data WHERE "timestamp" falls within the "SHI...
- 6 years ago
Hi Anonymous ,
We can merge tables based on Line name and filter the table based on the new custom column
let Source = Table.NestedJoin(Shifts, {"LINE NAME"}, #"Machine State data", {"Line Name"}, "Machine State data", JoinKind.LeftOuter), #"Expanded Machine State data" = Table.ExpandTableColumn(Source, "Machine State data", {"timestamp"}, {"Machine State data.timestamp"}), #"Added Custom" = Table.AddColumn(#"Expanded Machine State data", "Custom", each [Machine State data.timestamp]>=[SHIFT PERIOD START] and[Machine State data.timestamp]<=[SHIFT PERIOD END]), #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Custom] <> false)) in #"Filtered Rows"Pbix as attached.
v-frfei-msft
Community Support
6 years agoHi Anonymous ,
We can merge tables based on Line name and filter the table based on the new custom column
let
Source = Table.NestedJoin(Shifts, {"LINE NAME"}, #"Machine State data", {"Line Name"}, "Machine State data", JoinKind.LeftOuter),
#"Expanded Machine State data" = Table.ExpandTableColumn(Source, "Machine State data", {"timestamp"}, {"Machine State data.timestamp"}),
#"Added Custom" = Table.AddColumn(#"Expanded Machine State data", "Custom", each [Machine State data.timestamp]>=[SHIFT PERIOD START] and[Machine State data.timestamp]<=[SHIFT PERIOD END]),
#"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Custom] <> false))
in
#"Filtered Rows"
Pbix as attached.
Anonymous
6 years agoNot applicable
Frank:
Super Thanks for the DAX. THe .pbix file really helped as well so thank you for your time to make that. Now that i can see the method I understand it. Your help has allowed us to use the Teams shift schedule to filter machine state data. This should improve my report data accuracy significantly. Thank you again for your help.