HRS - Ask. Learn. Share Knowledge. Logo

In Computers and Technology / High School | 2025-07-08

You import two Microsoft Excel tables named Product and ProductCategory into Power Query.

Product contains the following columns:
- ProductID
- ProductName
- Price
- ProductCategoryID

ProductCategory contains the following columns:
- ProductCategoryID
- ProductCategoryName

You want to show the name, price, and the name of the category of the products. What should you do?

Options:
1. Append Product and ProductCategory tables.
2. Choose ProductName, Price, and ProductCategoryID from Product table.
3. Merge Product and ProductCategory tables by using ProductCategoryID and choose ProductName and Price from Product table and ProductCategoryName field from ProductCategory table.

Asked by xmilye8991

Answer (2)

The best approach to display the product name, price, and category name is to merge the Product table with the ProductCategory table using ProductCategoryID. After merging, choose to display the ProductName and Price from the Product table and ProductCategoryName from the ProductCategory table. This method provides a comprehensive view of the products along with their categories.
;

Answered by Anonymous | 2025-07-13

To solve this problem, you want to merge the data from two Microsoft Excel tables, Product and ProductCategory, in Power Query. The goal is to display the product name, the price, and the category name of each product. Here is a step-by-step guide to achieve this:

Open Power Query : First, import the two tables, Product and ProductCategory, into Power Query if you haven't already.

Merge Tables : Use the Merge feature in Power Query:

Select the Product table.
Click on 'Merge Queries' in the Power Query Editor.
Choose the Product table as the primary table and the ProductCategory table as the table you want to join with.
Select the ProductCategoryID column from both tables as the key to merge on. This will allow you to match each product with its category using their shared ProductCategoryID.


Expanded Columns : After merging, expand the ProductCategory table to add the ProductCategoryName into your main table:

Click on the small expand icon next to the merged column.
Select the ProductCategoryName field to be included in the final output.


Select Desired Columns : Choose the fields you need for your final table:

ProductName
Price
ProductCategoryName


Load Data : Once you've selected the necessary columns, load the data back to Excel or continue using it in Power Query as needed.


By following these steps, you will have a table displaying the product's name, price, and the category name. Therefore, the correct answer to select is Option 3 : Merge Product and ProductCategory tables by using ProductCategoryID and choose ProductName and Price from Product table and ProductCategoryName field from ProductCategory table.

Answered by danjohnbrain | 2025-07-21