Forum Discussion

Tucker's avatar
Tucker
Helper I
8 years ago
Solved

Date Sorting in Line Chart

Evening All (well in the UK!),

 

After some assistance with a line chart, I'm struggling to get the sort order I want to acheive. I understand that I could add columns and sort on those but not sure of the best way to achieve what I'm after?

 

So my data has a source price and a target price from which I have established a variance, this has then been calculated to a % variance. The origional data has transactions per row which have an invoice date eg each variance will belong to a date, these have been agrigated up using a CALCULATE(SUM with FILTER funtion so I now have the data grouped by YYYY,MM,DD if required with drill downs etc.

 

I also have a DIM date tbl which is joined on the transaction date etc.

 

What I'm trying to achieve is a sort on the line chart that will show today at the right and work backwards 12month to the left, like a running total if you like. Below is my visual with the vertical red line representing today which I'd like at the far right, I'd also like to keep the months and drill downs if poss. 

 

Thanks in advance guys

 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Tucker,

    Do you have year field and MonthName field in your table? You can drag the two fields to X-Axis of Line chart, then sort by YearMonth, for more details, please review the example in the video below.

    https://1drv.ms/u/s!AhsotbnGu1Nok2Hf0nL18Zx_T3m1

    Regards,
    Lydia

    • Tucker's avatar
      Tucker
      Helper I

      Thanks Lydia, Anonymous

       

      Perfect, had to do a slight tweak by adding the Year, Month and MonthName with a triple sort but works exactly as required thanks must have been having a senior moment!!