×
英语
很抱歉。本文没有你的语言版本。

Pivot columns

In Power Query, you can create a table that contains an aggregate value for each unique value in a column. Power Query groups each unique value, performs an aggregate calculation for each value, and pivots the column into a new table. Using this technique, you could, for example, easily get a count for the number of products in each product category.

Pivot Column Result

To pivot a column

Follow these steps:

  1. In the Query Editor ribbon, click Transform > Pivot Columns.  

  2. Choose a column from Values Column. For example, choose Product Number.

  3. Click the small arrow to expand Advanced options and choose an Aggregate Value Function. For example, choose Count (All).

  4. Click OK.

Example

As shown in the instructions given above, you can take a products table containing ProductCategory and ProductNumber columns and use the Pivot Column feature to get the count of all products in each category.

Pivot Column Example

Need more help?

You can always ask an expert in the Excel Tech Community, get support in the Answers community, or suggest a new feature or improvement on Excel User Voice.

扩展你的 Office 技能
了解培训
抢先获得新功能
加入 Office 预览体验计划

此信息是否有帮助?

谢谢您的反馈!

谢谢你的反馈! 可能需要转接到 Office 支持专员。

×