cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

Unable to sort by month when using scatter chart

Hi. I'm using scatter plot for my report. I want to sort by month. Everything works fine until I select the legend.

Picture below is when I remove legend.

zhrhr_0-1611058658296.png

 

Picture below is when I put the legend.

zhrhr_1-1611058688822.png

 

I tried to re-do it again, just in case if I'm mistaken anywhere, but it still shows the same error.

 

But if I'm using other types of chart, the order of month is correct. Can anyone help me with this? Why does this went wrong?

 

 

8 REPLIES 8
Super User III
Super User III

Hi @zhrhr ,

 

There are multiple threads for this issue in this forum. See one below:

https://community.powerbi.com/t5/Desktop/Sort-month-name-by-month-number/m-p/1515201

 

Thanks,

Pragati





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Hi @zhrhr ,

 

I tried something similar at my end. Below chart is witout LEGEND have got month in right sort order:

Pragati11_0-1611139243696.png

 

Now, when I move LEGEND to it I still get my MONTH sorted in the right order:

Pragati11_1-1611139305567.png

 

As I can't reproduce this issue at my end, Can you share you sample pbix file for this with both the charts on it - one with LEGEND, one without LEGEND?

 

Thanks,

Pragati





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




@Pragati11 hi, this is the pbix link. im not sure why it doesn't work only for scatter. If I change it to line or bar chart, it sorted month in order. but i needed a scatter chart. Please help https://1drv.ms/u/s!AoKh3nlpMpSOgmSAg1TMiavknFhn?e=NDMg6m

Hi @zhrhr ,

 

Go with the approach that @Ashish_Mathur has suggested if you are still having this issue.

The format of your Date column on that chart should be date type rather than datetime format. Also, sometimes if there are blanks or nulls in your date column which you are using on the chart, may also end up creating issues. Therefore, it is advised to have a Calendar table in your data model with relationship on your dataset used for reporting. Then use DATE column from this Calendar table on your chart.

 

For steps on doing this refer following article:

https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

 

 

Thanks,

Pragati





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Hi,

You should remove the time stamp from the "ACT_EXEC_COMP" column first.  Then, create a Calendar Table first and then build a relationship from the "ACT_EXEC_COMP" column to the Date column of your Calendar table.  In the Calendar Table, add columns for Year, Month name and Month number.  Sort the Column Name by Column Number.  To your visual, drag Year and Month name from the Calendar Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur hi, can you please show me an example? I don't quite get it

Hi,

To extraxt only the date from the column "ACT_EXEC_COMP" you will need to use the Query Editor.  When i go to the Query Editor in your file, i am asked for credentials.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors