问题
I am creating a Power BI report in Stacked column chart. Can I change the order in a column, just like show in the picture?
Hope some masters can help me to solve the problem!
回答1:
One way to achieve this is to define a custom column with values that will give you the desired sorting order, and then use Sort by column.
Open Power Query Editor
by clicking on Edit Queries
button, and in Add Column
tab click on Custom Column
. To reverse the sort order, you can subtract Level
from some bigger number, e.g. a million, so enter this formula:
Custom Sort Order = 1000000 - [Level]
Like this:
Close Power Query Editor
and apply the changes, then select your stacked column chart visual and in Fields
pane click on the Level
column. In Modeling
tab, click on Sort by Column
button and from the dropdown select the newly defined custom column:
This will sort the segments in reverse order.
来源:https://stackoverflow.com/questions/60405872/powerbi-change-order-in-one-column-in-stacked-chart