Forum Discussion

sugar_sugar's avatar
sugar_sugar
Regular Visitor
2 years ago
Solved

sort by multiple criteria

In Power BI Desktop, I am able to sort by multiple criteria when I set it up in a table first and then create a graph. However, when I create a bar chart, drill down to change it to a table and set t...
  • rajendraongole1's avatar
    2 years ago

    Hi sugar_sugar - In the data model view, create a new calculated column:.

    Sort your data by the new SortKey column.

    SortKey = [Category] & "-" & [SubCategory]

     

    Sort your data by the new SortKey column.

    Apply the sort in a bar chart:

    1. Add the Product,Category,Subcategory and Value columns to your bar chart.
    2. Select the bar chart visual, go to the Visualization pane, and find the Sort by dropdown.
    3. Choose SortKey from the dropdown to sort by your custom column.

     

     

    Did I answer your question? Mark my post as a solution! This will help others on the forum!
    Appreciate your Kudos!!