Forum Discussion
cgyan9
2 years agoRegular Visitor
Creating a conditional table from other tables
Hi All, I am hoping to create a new table C with certain values from Table A or Table B - Table C has the first column as Month - Year, the 2nd column should check the calculated measure of say hrs ...
- 2 years ago
let Source = Table.SelectRows(#"Table 1", each ([Location] <> " ")) & #"Table 2", #"Removed Duplicates" = Table.Distinct(Source, {"Month Yr", "Location"}) in #"Removed Duplicates"
cgyan9
2 years agoRegular Visitor
Sharing an outline of the tables that I have -
Table 1
| Month Yr | Location | Function | Hrs |
| Jan-24 | A | AA | 1 |
| Jan-24 | B | BB | 2 |
| Mar-24 | C | CC | 3 |
| Apr-24 |
Table 2 -
| Month Yr | Location | Function | Hrs |
| Mar-24 | C | CC | 1 |
| Apr-24 | B | BB | 2 |
| May-24 | C | CC | 2 |
Output Result Table - It should 1st check for values in Table 1, if blank in Table 1 then take values from Table 2
| Month Yr | Location | Function | Hrs |
| Jan-24 | A | AA | 1 |
| Jan-24 | B | BB | 2 |
| Mar-24 | C | CC | 3 |
| Apr-24 | B | BB | 2 |
| May-24 | C | CC | 2 |
lbendlin
2 years agoSuper User
let
Source = Table.SelectRows(#"Table 1", each ([Location] <> " ")) & #"Table 2",
#"Removed Duplicates" = Table.Distinct(Source, {"Month Yr", "Location"})
in
#"Removed Duplicates"