Add a column from an example (Power Query) (2024)

Skip to main content

Microsoft

Support

Support

Sign in

Sign in with Microsoft

Sign in or create an account.

Hello,

Select a different account.

Excel for Microsoft 365 Excel 2021 Excel 2019 Excel 2016 More...Less

In Power Query, you can add new columns by providing one or more sample values to help create it. You can do this from a current selectionor by providing input based on selectedcolumns.This is useful when you know the data you want in your new column, but you're not sure which transformations to use.

The following examples useweb data at this location: List of states and territories of the United States.

Add a column from an example (Power Query) (2)

The following steps are based on the video.

  1. To open a query, locate one previously loaded from the Power Query Editor, select a cell in the data, and then select Query > Edit. For more information see Create, load, or edit a query in Excel.

  2. Select Add Column > Column From Examples > From All Columns.

    TheAdd Columns From Examples pane appears with a new, blank column on the right.

    Add a column from an example (Power Query) (3)
  3. Enter a sample value for the new column data you want, and then press Ctrl + Enter. In thiscase, we entered "Montgomery, AL" to combine each capital with its respective state.

    Add a column from an example (Power Query) (4)

    To makeedits to the new column, double-click any text field,edit it, and then press Ctrl + Enter when done.

    The transformation steps appear above Data Preview.

    Add a column from an example (Power Query) (5)
  4. Select OK.

  5. Examine the step added to the Applied Steps section in the Query Settings pane by right-clicking the Step and selecting Edit Settings and the corresponding formula in the formula bar.

    Add a column from an example (Power Query) (6)

When adding a column from examples by selection, Power Query offers a helpful list of available fields, values, and suggested transformations for the selected columns. In this example based on the data in the video, create a new column to organize the states by how many representatives each has.

  1. To open a query, locate one previously loaded from the Power Query Editor, select a cell in the data, and then select Query > Edit. For more information see Create, load, or edit a query in Excel.

  2. To make it more convenient, move the column to the end uponwhich you want to base the column section by selecting Transform > Move > To End. In the example, move the Number of Repscolumn.

  3. Select Add Column > Column From Examples > From Selection. A blank column is added.

  4. Enter "1 to 7" as a range in the first blank cell.

  5. To see suggestions for all cells,press Ctrl + Enter.

  6. If you are satisfied, select OK.

    Sometimes, you may need to iterate a few times to get the results you want.

Results

Power Query arranges the data by subsets according to the range you entered. A quick way to see the subsets is to select AutoFilter on the new column. For example:

Add a column from an example (Power Query) (7)

After adding columns from examples, consider removing the original columns if you no longer need to display them. The new column data is not affected.

Adding a column from examples is based on the top 100 rows of Data Preview. Alternatively, you can add your own sample data, add a column example based on thatsample data, and then delete the sample data when you no longer need it. The newly created column won't be affected.

See Also

Power Query for Excel Help

Add a column from examples (docs.com)

Add a custom column

Add a column based on a data type

Power Query M formula language reference (docs.com)

Need more help?

Want more options?

Discover Community

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Add a column from an example (Power Query) (8)

Microsoft 365 subscription benefits

Add a column from an example (Power Query) (9)

Microsoft 365 training

Add a column from an example (Power Query) (10)

Microsoft security

Add a column from an example (Power Query) (11)

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Add a column from an example (Power Query) (12)

Ask the Microsoft Community

Add a column from an example (Power Query) (13)

Microsoft Tech Community

Thank you for your feedback!

×

Add a column from an example (Power Query) (2024)
Top Articles
6 Ways To Enjoy The Wellbeing Benefits Of Silence This Season – Toulouse, France
Occupancy taxes - Airbnb Help Center
Fort Morgan Hometown Takeover Map
Victory Road Radical Red
Gomoviesmalayalam
Fredatmcd.read.inkling.com
Arrests reported by Yuba County Sheriff
CHESAPEAKE WV :: Topix, Craigslist Replacement
Category: Star Wars: Galaxy of Heroes | EA Forums
Concacaf Wiki
Wmlink/Sspr
Cvs Devoted Catalog
Bernie Platt, former Cherry Hill mayor and funeral home magnate, has died at 90
Savage X Fenty Wiki
[2024] How to watch Sound of Freedom on Hulu
Zendaya Boob Job
Aspen.sprout Forum
Hoe kom ik bij mijn medische gegevens van de huisarts? - HKN Huisartsen
Les Schwab Product Code Lookup
Best Nail Salon Rome Ga
Kitty Piggy Ssbbw
Ostateillustrated Com Message Boards
Army Oubs
Hewn New Bedford
Katie Sigmond Hot Pics
Conan Exiles Sorcery Guide – How To Learn, Cast & Unlock Spells
College Basketball Picks: NCAAB Picks Against The Spread | Pickswise
Garnish For Shrimp Taco Nyt
2021 Volleyball Roster
Zillow Group Stock Price | ZG Stock Quote, News, and History | Markets Insider
Www Va Lottery Com Result
Gotcha Rva 2022
8000 Cranberry Springs Drive Suite 2M600
Koninklijk Theater Tuschinski
Piri Leaked
Move Relearner Infinite Fusion
Divide Fusion Stretch Hoodie Daunenjacke für Herren | oliv
Filmy Met
Issue Monday, September 23, 2024
Craigs List Tallahassee
Why Are The French So Google Feud Answers
Emily Katherine Correro
47 Orchid Varieties: Different Types of Orchids (With Pictures)
State Legislatures Icivics Answer Key
Compare Plans and Pricing - MEGA
Shane Gillis’s Fall and Rise
Vons Credit Union Routing Number
Costco Gas Foster City
Cleveland Save 25% - Lighthouse Immersive Studios | Buy Tickets
Gabrielle Abbate Obituary
Christie Ileto Wedding
Plasma Donation Greensburg Pa
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 6289

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.