Forum Discussion

Lauren_Michelle's avatar
Lauren_Michelle
Copper Contributor
Jan 20, 2023
Solved

Sorting Groups in Power BI

Hey everyone,  I have a complex sort order issue in Power BI. I have a huge amount of sales/volume data related to specific promotional periods - 17 periods in a year, roughly 3 weeks in length, w...
  • Lauren_Michelle's avatar
    Jan 21, 2023

    Issue resolved - I created a separate table in Excel with the Period Name (e.g. P1 2021) and corresponding sort order.

    I then loaded the table into Power BI, made a relationship between the 'Period Name' in my sorting table and the period name column assigned to my main database by the grouping function and created a new Column using the 'RELATED' function, which allocated the correct sort number to the corresponding period for every row.

    Then, when selecting the relevant grouping field, I did a 'Sort By' based on the new Column and it works perfectly.

    I simply applied the same 'Sort By' on the relevant grouping field measure (Ice Cream & Grocery) and it sorted the relevant periods in the correct order.

Resources