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
patquevillon
New Member

Date Sorting in Line Chart

Hello,

 

I want to display data ranging from November 2016 to now (March 2017, but will keep growing) in a line chart. My date field is a date (properly recognized as a date Hierarchy) and I want to keep the hiearchy mode and provide my users the ability to drill up-down through days, months, quarters, years.

 

Issues are the following: Power BI does not sort or aggregate properly.

 

- At the Day level the data is aggregated on the day numerical value (1 thru 30/31) so my axis has 0-31 data points instead of the expected 120 or so entries for the last 4 months.

- At the month level the data is sorted by month, but irregardless of the year. So I get : Jan, Feb, Mar, Nov, Dec Instead of the expected Nov, Dec, Jan, Feb, Mar (Nov and Dec being in 2016 while Jan, Feb, Mar are in 2017).

- At the Quarter level: same as for months. Q1 comes before Q4. I am expecting Q4 (2016) to come before Q1 (2017)

 

Any solutions to this ?

 

examples:

 

 

 

 

 

 

 

 

thanks

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

First question comes in my mind, do you have dedicated continuous calendar table? if not follow this link as example to create one and then use the fields from calendar table on your axis to achieve what you are looking for. Let me know if you need further help.

 

 

Thanks,

P



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
parry2k
Super User
Super User

First question comes in my mind, do you have dedicated continuous calendar table? if not follow this link as example to create one and then use the fields from calendar table on your axis to achieve what you are looking for. Let me know if you need further help.

 

 

Thanks,

P



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you Parry2k!

 

You put me on the right track. I ended up creating a Calendar table using your instructions (not as many fields and tweaking the syntax as my French Operationg System doesn't like the ";" ).

 

I was then able to link my source table to the Calendar on the date field and simply use the Calendar day, year-month and year-quarter as the elements of my axis hierarchy. Works like a charm.

Good to hear. Always get good feeling when there is a solution.

Cheers



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

60 days of Data Days Carousel

Data Days 2026

Join 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