更改 Power BI 报表中的图表排序方式Change how a chart is sorted in a Power BI report

在 Power BI 报表中,可以按图表中类别名称的字母顺序,或者每个类别的数值对大多数可视化对象排序。In a Power BI report, you can sort most visualizations alphabetically by the names of the categories in the chart, or by the numeric values of each category. 例如,下图按商店名称排序。For example, this chart is sorted by store name.

可以轻松地将排序依据从类别(商店名称)更改为值(每平方英尺销售额)。It's easy to change the sort from a category (store name) to a value (sales per square feet) instead.

  1. 选择省略号 (…),然后选择按每平方英尺销售额进行排序Select the ellipses (...) and choose Sort by Sales Per Sq Ft.
  2. 如有需要,可选择排序图标 更改为降序If necessary, select the sort icon to change to Descending.

    注意:并非所有视觉对象都可以排序。NOTE: Not all visuals can be sorted. 例如,以下视觉对象无法排序:树状图、地图、着色地图、散点图、仪表图、卡片图、多行卡片图、瀑布图。For example, the following visuals cannot be sorted: Treemap, Map, Filled Map, Scatter, Gauge, Card, Multi Row Card, Waterfall.

使用其他条件排序Sorting using other criteria

有时候,你想使用不同的字段或其他条件对视觉对象排序。Sometimes, you want to sort your visual using a different field or other criteria. 例如,你可能想按月份(而不是字母顺序)排序,或者按整个数值而不是数字排序(例如 0、1、9、20,而不是 0、1、20、9)。For example, you might want to sort by month (and not in alphabetical order) or you might want to sort by entire numbers instead of by digit (example, 0, 1, 9, 20 and not 0, 1, 20, 9).

在某些情况下,你可以按照你想要的方式对视觉对象进行排序,例如按月。In some cases, you may be able to sort the visual the way you'd like, for example, by month. 但如果不是,可能是因为报表背后的数据集需要一些调整。But if not, it may be because the dataset behind the report needs some tweaking. 下面提供了几种解决方案:Here are several solutions:

  • 在 Power BI Desktop 中,可以使用“Data Tools 模型”选项卡按不同的列进行排序In Power BI Desktop, use the Data Tools Modeling tab to sort by a different column.
  • 在 Excel 中,如果你是数据集的所有者,则可以添加连接月份名称和数字的新列。In Excel, if you own the dataset, add a new column that concatenates the month name and number. 然后刷新或重新导入数据集,确保新列位于“字段”区域中。Then refresh or re-import the dataset to see the new column in the Fields area.
  • 在 Excel 中,确保将数值列标记为“整数”或“小数”,而不是“文本”。In Excel, ensure that your numerical columns are tagged as "whole number" or "decimal" and not as "text."

后续步骤Next steps

Power BI 报表中的可视化对象的详细信息。More about Visualizations in Power BI reports.

Power BI - 基本概念Power BI - Basic Concepts

更多问题?More questions? 尝试参与 Power BI 社区Try the Power BI Community