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

Sort by another column issue

So currently I am trying to display the date and month in order but get the following:

 

capture.png

 

 I have setup my calendar table as:

 

PROD Calendar =
VAR Days = CALENDAR(MIN('LCP_Contacts'[Visited Date]),MAX('LCP_Contacts'[Visited Date]))
RETURN ADDCOLUMNS(
  Days,
  "Year", YEAR([Date]),
  "Year Sort", 10000 - YEAR([Date]),
  "Month Number", MONTH([Date]),
  "Month", FORMAT([Date],"mmmm"),
  "Month Year Number", YEAR([Date]) * 100 + MONTH([Date]),
  "Month Year Text", FORMAT([Date],"mmm yyyy"),
  "Date Month Number", DAY([Date]) + MONTH([Date]) * 100 + YEAR([Date]) *10000,
  "Date Month Text", FORMAT([Date], "dd mmm"),
  "Fiscal Year", YEAR([Date]+184),
  "Fiscal Year Sort", 10000 - YEAR([Date]+184)
)

 

I have setup the chart with the following details:

capture1.png

 

And have tried selecting the line chart then selecting the field and clicking on Sort by Column:

capture2.pngcapture3.png

 

Does not help and the line chart stays the same.

 

This is what the calendar table looks like:

capture4.png

 

Can anybody provide me with some help as what I am doing wrong here?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Sort by another column issue

I just found a work around by adding the "Date Month Number" field to the Tooltips and then I can sort:

capture7.png

View solution in original post

9 REPLIES 9
Highlighted
Super User I
Super User I

Re: Sort by another column issue

@tiztrain Can you please check and confirm whether the "Date Month Number" field is "Whole Number" Data Type or not.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helper I
Helper I

Re: Sort by another column issue

capture5.png

 

Sorry forgot to mention that I had checked this

Highlighted
Microsoft
Microsoft

Re: Sort by another column issue

Hi @tiztrain

 

It seems you may try to add another table to set the order. Below is the article for your reference. If it is not your case, please share some data sample and expected output. You can upload it to OneDrive or Dropbox and post the link here.

 

http://www.excelnaccess.com/custom-sorting-in-power-bi/

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Super User I
Super User I

Re: Sort by another column issue

@tiztrain Did you tried with this option on the chart.

 

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Helper I
Helper I

Re: Sort by another column issue

capture6.png


The chart displays in Date Month Text but I want to sort by the Date Month Number.

 

How can I add this as an option to sort by?

Highlighted
Helper I
Helper I

Re: Sort by another column issue

I just found a work around by adding the "Date Month Number" field to the Tooltips and then I can sort:

capture7.png

View solution in original post

Highlighted
Microsoft
Microsoft

Re: Sort by another column issue

Hi @tiztrain

 

Glad to hear you've solved it, please accept the helpful answer or your solution as solution, that way, other community members will easily find the solution when they get same issue.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: Sort by another column issue

I was still wondering if there is a better way to do it?
Highlighted
Microsoft
Microsoft

Re: Sort by another column issue

Hi @tiztrain

 

Based on my test, it seems there is no better way to do that.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors