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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.