Data Types – Part 1 – Create Your Own Data Types in Power Query (original) (raw)

How can you create your own data types in Excel? Oh yes, you can do it! In this article, we’ll learn how you can create data types in Power Query. Follow the tutorial below.

If you don’t know about data types, we recommend you first watch an introductory video here.

How – to

We’ll start with the following tables: the first is the Product table.

![Table

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/table-description-automatically-generated-9.png)

And second is the Sales table.

![Table

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/table-description-automatically-generated-10.png)

To load to Power Query, select the Sales table and go to Data > From Sheet.

![Table

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/table-description-automatically-generated-11.png)

Repeat for the Product table. We now have both tables in Power Query.

![Table

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/table-description-automatically-generated-12.png)

Select ProductID column in Sales table and then Home > MergeQueries.

![Table

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/table-description-automatically-generated-13.png)

Set column Product table as the second table and select the ProductID column.

![Table

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/table-description-automatically-generated-14.png)

Confirm with OK.

What we’re doing here is we’re actually merging the dimension table the fact table. We would usually never do that, but we’ll demonstrate one useful reason to do it.

Expand the Product name, the Product Category and ProductGroup columns.

![Graphical user interface

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/graphical-user-interface-description-automaticall-1.png)

Move the three columns left, right after ProductID.

![Table

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/table-description-automatically-generated-15.png)

Create the Data Type

The step you’ve been waiting for! Select the 4 column and then Transform > Create Datatype.

![Graphical user interface, table, Excel

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/graphical-user-interface-table-excel-descriptio-2.png)

Enter Product as Data type name and ProductsID as Display column. Confirm with OK.

![Graphical user interface, application

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/graphical-user-interface-application-description-1.png)

Here’s what will happen: only Products column will remain, the rest will be »inserted« into the Products column.

As we see we only the Products column remains. It’s a data type and it also has the expand option.

![Table, Excel

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/table-excel-description-automatically-generated-3.png)

If we open the Expand button, we get the available columns we know. We won’t expand the column so just click Cancel here.

![Graphical user interface, text, application

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/graphical-user-interface-text-application-descr-1.png)

We’ll load the tables into Excel. Select Home > Close and load.

Table we get in Excel looks the same as table before.

![Graphical user interface, table, Excel

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/graphical-user-interface-table-excel-descriptio-3.png)

If we select a value in Products column, we get an icon on the right.

![Graphical user interface, application, table, Excel

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/graphical-user-interface-application-table-exce-1.png)

As we click the icon, we see all the columns we saved to this new data type! This means there are multiple columns within Products column.

![Table

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/table-description-automatically-generated-16.png)

Let’s expand Product Name column.

![Table, Excel

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/table-excel-description-automatically-generated-4.png)

Let’s also expand ProductCategory.

![Table, Excel

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/table-excel-description-automatically-generated-5.png)

Anytime you need that additional info you simply add it to the table!

![Table

Description automatically generated](https://excelunplugged.com/wp-content/uploads/2022/01/table-description-automatically-generated-17.png)

We packed the dimension table to the fact table, and we can call up the additional columns anytime we need them. How useful is that!

This concludes our example of how to create your own data types in Power Query. Stay tuned for Part 2, where we’ll show how to do this in Power BI.

Watch the tutorial

Meanwhile, you can also watch the tutorial online on our YouTube channel!

Creating Data Types in Excel – video tutorial

Please leave us a like, comment, and subscribe for more amazing Excel tricks!

Follow us on LinkedIn.

Check out R Academy!