Forum Discussion
Sorting Groups in Power BI
- 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.
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.