Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Tucker
Helper I
Helper I

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

Capture.JPG

 

1 ACCEPTED SOLUTION
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

View solution in original post

2 REPLIES 2
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

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!!

 

Capture.JPG

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors