Power BI date sorti...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] Power BI date sorting on a line graph.

11 Posts
9 Users
0 Reactions
102 Views
Posts: 11884
Full Member
Topic starter
 

Just starting to learn Power BI and almost immediately I've come across a a stupid problem where it organises a month/year axis alphabetically on a line chart. (Apr, Aug, Dec etc.) This is because its tagged as a text column in my date table, but it won't let me change to a date column format because it won't accept Jan 21 is a date. 😕

I can't be the first! So far Dr Google hasn't helped. Any clues?


 
Posted : 28/01/2021 4:44 pm
Posts: 77347
Free Member
 

Good timing.

A work colleague is an absolute expert here. Unfortunately, he left the business 25 minutes ago so I can't ask him.


 
Posted : 28/01/2021 4:56 pm
Posts: 11884
Full Member
Topic starter
 

Left, as in went home for the evening, or left? Strikes me that might have been really bad timing! 😁


 
Posted : 28/01/2021 5:47 pm
Posts: 10761
Full Member
 

Does this help?

https://www.sqlshack.com/how-to-sort-months-chronologically-in-power-bi/

I have a love/hate relationship with Power BI but most often the issues stem from the structure of your data model get that right and it pays off, get it wrong and you're in for the hell of obscure DAX expressions.


 
Posted : 28/01/2021 6:10 pm
Posts: 1831
Full Member
 

You need to go back to the query editor and get that field to be a date.


 
Posted : 28/01/2021 6:51 pm
Posts: 10474
Free Member
 

Was nervous opening thread.
Obviously did so I appear to be Power BI curious. Never heard of this. Off to google...


 
Posted : 28/01/2021 6:54 pm
Posts: 11884
Full Member
Topic starter
 

That looks like it may well help, thanks. I'll spend some time to work through it properly later.

I'm already finding that about the data structure. One of my colleagues gave me one of his dashboards to give me some ideas and a headstart, trying to follow his data is a flipping nightmare and I'm sure a lot of it is unused.


 
Posted : 28/01/2021 6:56 pm
Posts: 13369
Full Member
 

I thought you were going to be discussing Sorting on a line graph on a speed / power date sort of thing with someone who was Bisexual.

Easy mistake to make. Sorry, in this case I have nothing to add


 
Posted : 28/01/2021 6:59 pm
 mrmo
Posts: 10687
Free Member
 

Normal approach is through the model, set it to a date type there, or, not 100% sure but can you create an index field to sort by and use the text as a label.


 
Posted : 28/01/2021 7:41 pm
Posts: 8527
Free Member
 

I need to get into this, it's in my objectives to have a monthly reliability/asset availability presentation using power BI.

I'm not even particularly good at excel, gonna be fun. 🙈


 
Posted : 28/01/2021 7:59 pm
Posts: 1142
Full Member
 

If only your work colleague had been on STW for years Cougar!

As mentioned above, PowerBI will only sort it in date order if you can get it to recognise the field as a date - but luckily it’s pretty flexible in doing this. You’ve given the example of ‘Jan 21’ as what you have in text format, is all your data in this format?
RM.


 
Posted : 28/01/2021 8:06 pm
Posts: 77347
Free Member
 

If only your work colleague had been on STW for years Cougar!

I knew that! I just couldn't remember the goddamn username.


 
Posted : 28/01/2021 11:09 pm

6 DAYS LEFT
We are currently at 95% of our target!