PowerBI图表中的自定义排序 [英] Custom sorting in PowerBI chart
问题描述
最近,我遇到了一个问题,需要根据PowerBi报表中定义的方式显示列顺序。
问题是,PowerBI按升序(A-> Z)或降序(Z-> A)的顺序对列进行排序,那么如果必须应用自定义顺序,他应该如何实现呢?
以下是示例
在这里我们可以看到X轴上的顺序是递增的,或者可以显示它是递减的,但是如果我想根据自己的需要对顺序进行排序,该怎么办?可能如下所示:
1.2 Wheel Preview-> 1.2 GTR-> 1.2 Ultra-> 1.2 RTR
,在创建报告时是否可以在PowerBI桌面中进行操作,如果可以,那么将很容易理解要遵循的准则。 :)
谢谢。
在您的源数据中添加一列,并使用所需排序顺序的值填充它。然后选择要自定义排序的列,然后单击建模>按列排序。选择新列作为现有列的SortBy列,如屏幕截图所示:SortCategory列用作Category列的排序顺序。
Recently I came across one issue in which I need to show the column order as per my defined way in PowerBi report. Thing is, PowerBI sorts the columns in either Ascending(A->Z) or descending(Z->A) order, then if one has to apply his custom order how he should achieve this?
Here is and example
Here we can see the order on X-Axis is ascending or we can show it descending, but what if i would like to sort the order with respect to my need; may be as below :
1.2 Wheel Preview --> 1.2 GTR --> 1.2 Ultra --> 1.2 RTR
, Would it be possible in PowerBI desktop while creating the report, if yes, then guidelines to be followed will be well appreciated. :)
Thanks.
Add a column to your source data and populate it with values for the desired sort order. Then select the column you want to custom sort and click Modeling > Sort by Column. Select the new column as the SortBy column for the existing column, like in the screenshot: The SortCategory column is used as the sort order for the Category column.
Now create a chart and the categories on the axis will be sorted according to the values of the SortCategory column.
这篇关于PowerBI图表中的自定义排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!