search
HomeComputer TutorialsComputer KnowledgeHow to reorder multiple columns in Power Query via drag and drop

How to reorder multiple columns in Power Query via drag and drop

Mar 14, 2024 am 10:55 AM
sortqueryarrangementpower

In this article, we will show you how to reorder multiple columns in Power Query by dragging and dropping. Often, when importing data from various sources, columns may not be in the desired order. Reordering columns not only allows you to arrange them in a logical order that suits your analysis or reporting needs, it also improves the readability of your data and speeds up tasks such as filtering, sorting, and performing calculations.

如何通过拖放在Power Query中对多列进行重新排序

How to rearrange multiple columns in Excel?

In Excel, there are many ways to rearrange columns. You can simply select the column header and drag it to the desired location. However, this approach can become cumbersome when dealing with large tables with many columns. To rearrange columns more efficiently, you can use the enhanced query editor. With the enhanced query editor, you can easily select multiple columns in the order you need and drag them together to the desired location. This allows you to quickly rearrange columns in large tables without having to constantly drag and scroll. The enhanced query editor provides a more convenient way to manage and adjust the order of columns, making your work more efficient and convenient.

How to reorder multiple columns in Power Query using drag and drop functionality

To reorder multiple columns in Power Query via drag and drop, you must perform the following steps:

Suppose we have a sample data source as shown below. So our first step is to open it in the Power Query editor. Select the data source and click the From table/range option in the Get data section under the Data tab.

如何通过拖放在Power Query中对多列进行重新排序

&Reorder multiple columns using drag and drop

After opening data in the Enhanced Query Editor, you can customize the display order by holding down the Ctrl key and selecting the desired columns. For example, you can rearrange DepartmentID and EmployeeID to suit your needs. This flexibility allows you to easily adjust the order of data display to suit your specific needs and preferences.

Department ID, employee ID, employee name, joining date, gender, salary code

I will select them in the order shown in the screenshot below:

如何通过拖放在Power Query中对多列进行重新排序

After selecting the columns, click and hold the left mouse button on any selected column header, then drag the pointer to where you want to place the column. Release the mouse button to drop the column to its new location. They will be rearranged in the desired order.

如何通过拖放在Power Query中对多列进行重新排序

Finally, click the Close&Load button in the top menu of the Power Query editor to apply the changes and load the reordered data back into the worksheet.

如何通过拖放在Power Query中对多列进行重新排序

Note:

  • If you want to rearrange all columns in the data source, you must drag the selection to the right of the last column and release the mouse button. If you drag the column to the left, nothing happens.
  • To reverse the order of columns in the data source, select the last column, hold down the Shift key, and then select the first column. Then click and hold the left mouse button on the last column header and drag the pointer to the right. Release the mouse button and the column order will be reversed. You can follow the same steps to reverse the order of just a few columns. This also allows the selection to be dragged to the left.
  • To "Undo" a reordering, right-click on the "Reordered Columns" step under "Applied Steps" in the query settings panel on the right and select "Delete".
  • Another way to reorder columns in Power Query

    When you reorder columns in Power Query, a Table.ReorderColumns function is created. You can also reorder multiple columns at once by modifying the formula text in the Table.ReorderColumns function. ReorderColumns function (if you cannot see this function, right-click on any column header and select Move > Left/Right/To Begin/to End from the context menu).

    Edit the formula text by placing your cursor on the top formula bar and typing the column headings in the desired order. Titles are enclosed in double quotes and separated by commas. Delete the previous entry for the added column and press Enter to apply the changes.

    This is how to quickly reorder multiple columns in Power Query without having to move each column individually. I hope you'll find this useful.

    The above is the detailed content of How to reorder multiple columns in Power Query via drag and drop. For more information, please follow other related articles on the PHP Chinese website!

    Statement
    This article is reproduced at:每日运维. If there is any infringement, please contact admin@php.cn delete
    Download Hidester VPN/Proxy to Access Your Favorite Content - MiniToolDownload Hidester VPN/Proxy to Access Your Favorite Content - MiniToolApr 22, 2025 am 12:50 AM

    Learn about Hidester VPN and Hidester proxy and download Hidester VPN for Windows, Mac, Android, and iOS to use this VPN service to view websites with no limit. For more useful free computer tools and troubleshooting tips, you may visit php.cn Softwa

    Windows Keyboard Opening Shortcuts Instead of Typing [Fixed]Windows Keyboard Opening Shortcuts Instead of Typing [Fixed]Apr 22, 2025 am 12:48 AM

    Have you ever encountered the trouble of “Windows keyboard opening shortcuts instead of typing”? In this post from php.cn, you will learn how to fix this issue.

    Easy Ways to Add the Control Panel Icon to Desktop on Win 10 / 11Easy Ways to Add the Control Panel Icon to Desktop on Win 10 / 11Apr 22, 2025 am 12:46 AM

    In this post, php.cn Software will introduce what Control Panel is and how to add the Control Panel icon to desktop on your Windows 10 or Windows 11 computer. You can also learn some related information about desktop icon settings.

    Granblue Fantasy Relink Save File Location & Backup Save DataGranblue Fantasy Relink Save File Location & Backup Save DataApr 22, 2025 am 12:45 AM

    If you play Granblue Fantasy: Relink on your PC, you may wonder where you can find its save file. In this post, php.cn introduces everything you want to know - Granblue Fantasy Relink save file location and how to back up the savegame of this game.

    How to Fix Event ID 1104: The Security Log Is Now Full? - MiniToolHow to Fix Event ID 1104: The Security Log Is Now Full? - MiniToolApr 22, 2025 am 12:44 AM

    Event Viewer keeps track of activity for better management. However, if the upper limit of the security log is reached, no more events can be logged. In this post on php.cn Website, we will show you how to deal with Event ID 1104 the security log is

    Watch: How to Enable Secure Boot on Gigabyte Motherboard?Watch: How to Enable Secure Boot on Gigabyte Motherboard?Apr 22, 2025 am 12:43 AM

    Secure Boot is a security standard that can prevent your computer from booting with untrustworthy software. Enabling it will add an extra layer of security to your device. In this post from php.cn Website, we will show you how to enable Secure Boot o

    Windows 11 23H2 Release Date: September 26, 2023 - MiniToolWindows 11 23H2 Release Date: September 26, 2023 - MiniToolApr 22, 2025 am 12:42 AM

    Coming to a new year, what Windows 11 users are looking forward to are not only the patch updates but also the annual major update for Windows 11. This post will talk about the Windows 11 23H2 release date. In addition, if you want to recover deleted

    How to Turn off Bixby on Samsung Phone? See a Guide! - MiniToolHow to Turn off Bixby on Samsung Phone? See a Guide! - MiniToolApr 22, 2025 am 12:41 AM

    Can you completely disable Bixby? How to turn off Bixby on Samsung phones? It is not hard to disable this voice assistant. In this post from php.cn, we will go to any length to help you find the method. Besides, a way to turn off “Hi, Bixby” is also

    See all articles

    Hot AI Tools

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Clothoff.io

    Clothoff.io

    AI clothes remover

    Video Face Swap

    Video Face Swap

    Swap faces in any video effortlessly with our completely free AI face swap tool!

    Hot Tools

    Notepad++7.3.1

    Notepad++7.3.1

    Easy-to-use and free code editor

    Dreamweaver Mac version

    Dreamweaver Mac version

    Visual web development tools

    ZendStudio 13.5.1 Mac

    ZendStudio 13.5.1 Mac

    Powerful PHP integrated development environment

    SAP NetWeaver Server Adapter for Eclipse

    SAP NetWeaver Server Adapter for Eclipse

    Integrate Eclipse with SAP NetWeaver application server.

    DVWA

    DVWA

    Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software