Create a data type (Power Query) (2024)

Excel has anumber of linked data types that you can use right away. But, you can also create your own data type from any supported data source by using Power Query. First you import your data with Power Query, then you shape the data the way you want, and finally you load the data type into a worksheet so you can work with the data. Like all data types, you can view the data in an Excel table, display it as an easy-to-read card, or use it in formulas.

Create a data type (Power Query) (1)

Note Creating a new data type is supported in Microsoft 365. For more information about ensuring you have an up-to-date subscription, see Microsoft 365 for business subscription.

Create a data type by using the Power Query Editor

The following procedure uses an example based on a list of American presidents from Wikipedia.

Phase 1: import your data

  1. To import the data from the web, select Data > From Web.

  2. In the URL box, enter "https://en.wikipedia.org/wiki/List_of_presidents_of_the_United_States", and then select OK.

  3. In the left pane of the Navigator dialog box, select Presidents, which shows the data in Table View, and then select Transform Data (at the bottom, right-hand corner).

    Create a data type (Power Query) (2)

Phase 2: shape your data

  1. The Power Query Editor opens with the data you selected.

  2. Select one or more columns. In this example, select President2, Party[b]2, Election, and Vice President. The order of the column in the new data type is determined by the order of selection.

    Tip To select any column, press Ctrl+Click. To select adjacent columns, press Shift+Click.

    Create a data type (Power Query) (3)

    Note Power Query automatically displays the associated M formula in the formula box. For more information, see Power Query M formula language.

  3. Select Transform > Create Data Type, which opens the Create Data Type dialog box.

  4. To change the column header for the data type, in the Data type name box, enter "US President". This column header is also the name of the data type.

  5. To specify the display column for the data type, select Display Column. For example, select President2 which contains the President’s name.

    Note The default display column is the first selected column.

  6. Optionally, select Advancedto see all available columns, re-select which are displayed, and re-arrange the sequence of those selected columns.

  7. When finished, select OK.

Results

The data type column with a data type icon and column header named "US President" is created. All the columns you initially selected arecollapsed into this one column.

Create a data type (Power Query) (4)

Note A new step is created in the Applied Steps section of the Query Settings pane. For more information, see Create Power Query formulas.

Phase 3: add the data type to an Excel table

  1. To addthe data type to an Excel table on a worksheet, select Home > Close & Load. Using a Power Query data typeis only supported in an Excel table.

    The data type displays theInsert Databutton

    Create a data type (Power Query) (5)

    which you use to work with each column.

    Create a data type (Power Query) (6)
  2. You can work with your new data type in various ways. For example:

    Extract one of the data type properties, such as Vice President, into a column in the table, by selecting the Insert Databutton

    Create a data type (Power Query) (7)

    :

    Create a data type (Power Query) (8)

    View column information in a card, such as John Adams, by selecting thedata type icon:

    Create a data type (Power Query) (9)

    Extract one of the data type properties, such as Election, into a column in the table, by using the equal sign (=) and Intellisense:

    Create a data type (Power Query) (10)

    For more information, see How to write formulas that reference data type.

Create a nested data type

You can also create data types that contain data types, in case you need to organize your data in multiple levels:

  1. Create a data type using the Power Query Editor, as explained previously.

  2. Repeat the same steps, but now, when you open the Create Data Type dialog box, select the previously created data type in the Display column:

    Create a data type (Power Query) (11)

    You can give the new data type any name you like; in this example, it’s “President_2”.

  3. Select OK.


The result will be a data type that contains the previous data type you created.

To add the data type to an Excel table on a worksheet, select Home > Close & Load.
Recall: Using a Power Query data type is only supported in an Excel table.

Now, you can view the sub-data type by selecting it from the card:
Create a data type (Power Query) (12)

You can go back to the top-level data type by pressing the back arrow in the top corner:

Create a data type (Power Query) (13)

For more information about working with data types, including how to refresh data and addimages to a card, see Linked data types FAQ and tips.

More about creating data types

Import data from external data sources (Power Query)

About Power Query

Create Power Query formulas

How to use linked data types with Excel

Excel data types: Stocks and geography

Create a data type (Power Query) (2024)
Top Articles
Wealthsimple sells US book of business to Betterment as company claims renewed focus on Canada | BetaKit
Stock trader salary ‐ CareerExplorer
Dunhams Treestands
Rubratings Tampa
Puretalkusa.com/Amac
How Far Is Chattanooga From Here
Lqse-2Hdc-D
Dusk
C-Date im Test 2023 – Kosten, Erfahrungen & Funktionsweise
7440 Dean Martin Dr Suite 204 Directions
Byte Delta Dental
G Switch Unblocked Tyrone
Alfie Liebel
Army Oubs
Our History
Fort Mccoy Fire Map
Sulfur - Element information, properties and uses
Stihl Dealer Albuquerque
European Wax Center Toms River Reviews
Watertown Ford Quick Lane
Waters Funeral Home Vandalia Obituaries
Ultra Ball Pixelmon
3 Ways to Format a Computer - wikiHow
Tokioof
Loopnet Properties For Sale
Vlocity Clm
Pch Sunken Treasures
Jambus - Definition, Beispiele, Merkmale, Wirkung
Consume Oakbrook Terrace Menu
42 Manufacturing jobs in Grayling
Cbs Fantasy Mlb
Body Surface Area (BSA) Calculator
Craigslist Jobs Brownsville Tx
Merkantilismus – Staatslexikon
Pokemon Reborn Locations
Red Dead Redemption 2 Legendary Fish Locations Guide (“A Fisher of Fish”)
Review: T-Mobile's Unlimited 4G voor Thuis | Consumentenbond
Wrigley Rooftops Promo Code
A Comprehensive 360 Training Review (2021) — How Good Is It?
San Bernardino Pick A Part Inventory
Engr 2300 Osu
Who Is Responsible for Writing Obituaries After Death? | Pottstown Funeral Home & Crematory
Bekah Birdsall Measurements
Subdomain Finder
Tattoo Shops In Ocean City Nj
Craigslist Woodward
Gw2 Support Specter
Erespassrider Ual
Dietary Extras Given Crossword Clue
Skyward Login Wylie Isd
Unit 4 + 2 - Concrete and Clay: The Complete Recordings 1964-1969 - Album Review
Latest Posts
Article information

Author: Annamae Dooley

Last Updated:

Views: 6391

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Annamae Dooley

Birthday: 2001-07-26

Address: 9687 Tambra Meadow, Bradleyhaven, TN 53219

Phone: +9316045904039

Job: Future Coordinator

Hobby: Archery, Couponing, Poi, Kite flying, Knitting, Rappelling, Baseball

Introduction: My name is Annamae Dooley, I am a witty, quaint, lovely, clever, rich, sparkling, powerful person who loves writing and wants to share my knowledge and understanding with you.