Forum Discussion

Displaced_2000's avatar
Displaced_2000
Frequent Visitor
2 years ago

date created by measure and sorting

If have created a measure which adds varying amount of months to a date (a date from a column) using EDATE().  The months added vary on multiple criteria so the resulting dates do not follow the original cronology. 

 

When I have the date formatted as standard (dd/mm/yy) I can sort this easily either ascending or decending.  But I want to format the date as mm/yy and to do this i am using FORMAT() but this then sorts all months together regardless of year.

 

Is there a solution to this?

 

 

3 Replies

  • JoeBarry's avatar
    JoeBarry
    Icon for Solution Sage rankSolution Sage

    Hi Displaced_2000 

     

    Create another column like this 

     

    Month Index = Format('DIM Date'[Date], "YYMM")

     

     convert to number and sort the mm/yy column by the new Month Index column

     

    That should do the trick

    Joe

     

    If this post helps, then please Accept it as the solution

  • Hi JoeBarry Many thanks

     

    The mm/yy is not a column but created by a measure, does this make a difference.  I cant see any way to order a measure used in a table visual by any other column?

    • JoeBarry's avatar
      JoeBarry
      Icon for Solution Sage rankSolution Sage

      Ah good question, 

       

      my idea was when a column existed. Is it possible to change your measure to yy/mm ? It should sort this way