Forum Discussion
scott_od
3 years agoFrequent Visitor
Complex comparison of two excel files
I'm looking for some help please with this scenario which is too complex for me to resolve with my power query knowledge. Scenario I have 2 tables: - tabel 1 contains a list of items ordered by ...
- 3 years ago
I've managed to resolve this now, I'm not sure it's the most elegant or efficient solution, but it gives the result I was looking for:
- Load both Table 1 and Table 2 into Power Query.
- Add 'Key' column to both Table 1 and Table 2 ('Week'-'Item')
- New Query 'Table 3' based on Table 1
- Group by 'Key' (Sum 'Ordered')
- Merge Table 1 and Table 2 using 'Key'
- Expand merged table with 'Received'
- Add a custom column "Status' with the following formula:
- if [Received] = [Ordered] then "Correct amount"
- else if [Received] > [Ordered] then "More items"
- else if [Received] < [Ordered] then "Less items"
- else "Not related"
- Merge Table 1 and Table 3 using 'Key'
- Expand merged table with 'Received' and 'Status'
scott_od
3 years agoFrequent Visitor
I've managed to resolve this now, I'm not sure it's the most elegant or efficient solution, but it gives the result I was looking for:
- Load both Table 1 and Table 2 into Power Query.
- Add 'Key' column to both Table 1 and Table 2 ('Week'-'Item')
- New Query 'Table 3' based on Table 1
- Group by 'Key' (Sum 'Ordered')
- Merge Table 1 and Table 2 using 'Key'
- Expand merged table with 'Received'
- Add a custom column "Status' with the following formula:
- if [Received] = [Ordered] then "Correct amount"
- else if [Received] > [Ordered] then "More items"
- else if [Received] < [Ordered] then "Less items"
- else "Not related"
- Merge Table 1 and Table 3 using 'Key'
- Expand merged table with 'Received' and 'Status'