Forum Discussion
Sort matrix/table by latest month column
- 3 years ago
Oldnewbie in this case you can achieve it by creating a calcualted table like below. You can apply year and month filter based on the current date and make filter dynamic as well.
in this case i have order table which has transactional level data for each product and its category. from this table i have creted a summarize table like below
Table_Product_rank = SUMMARIZECOLUMNS(Orders[Product Category],FILTER('Calendar',YEAR('Calendar'[Date].[Year]=2022)),FILTER('Calendar','Calendar'[Month#]="12"),"Sales",SUM(Orders[Sales]))then added rank calc column in this tableRank = RANK.EQ(Table_Product_rank[Sales],Table_Product_rank[Sales],DESC)this table will alwasy be sorted based on the latest month volume like belowyou can sort the above table on the rank category
then you can link this table to your main order table,
then in your matrix visual you can use the category from the newly created table and data will be sorted based on the data in the new table.
have attached the pbix file as well.
Oldnewbie in this case you can achieve it by creating a calcualted table like below. You can apply year and month filter based on the current date and make filter dynamic as well.
in this case i have order table which has transactional level data for each product and its category. from this table i have creted a summarize table like below
you can sort the above table on the rank category
then you can link this table to your main order table,
then in your matrix visual you can use the category from the newly created table and data will be sorted based on the data in the new table.
have attached the pbix file as well.