Forum Discussion

cathryn13's avatar
cathryn13
Frequent Visitor
4 years ago
Solved

Sorting columns behavior in matrix not working

Hello All   I'm beating my head against wall on this.  I have a matrix that I'm trying to sort my columns by dates desc.  If I use just the date iteself, it sorts correctly descending.  But, if I t...
  • cathryn13's avatar
    4 years ago

    Just in case anyone has this issue, I found a solution.  This may not be the most optimal but it works...

     

    I wrote my SQL code to have 2 Rank() Over functions, one that ranks the date column in Desc order and a 2nd that Ranks the Year in Desc Order.

     

    I'm sure you could create the same columns in Power BI, I'm just more comfortable, writing SQL vs DAX