Forum Discussion

A_Duet's avatar
A_Duet
Frequent Visitor
2 years ago
Solved

Dynamically sorting matrix column order by a date slicer?

I don't know if it is possible, but I am trying to control the column order in a matrix based on a date slicer.....to no avail. I would like the months to show in proper order but the left most column should be the beginning date in the slicer. Based on the date range in the image below, it should show July, August, September, etc. The matrix column order needs to dynamically change based on the slicer, but still show all 12 months. Is this even possible? Perhaps some combination of RANK and/or SWITCH? Any adivce would be greatly appreciated. 

 

 

3 Replies

    • A_Duet's avatar
      A_Duet
      Frequent Visitor

      This worked beautifully! Thank you for the help and including the pbix. Well done!

  • Where is your months coming from? if you're using the default date heirarchy that is generated from a date table (or the auto time-intelligence feature), then just add back in the year to your matrix header so that it will sort by year-month. Otherwise, create a column for the month, and a sort column with some DAX like Month Sort = INT(FORMAT('Calendar'[Date], "yyyymm")), and then use that to sort. 

    Either way, you need to somehow include the YEAR in your table so that your matrix will display properly.