cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tiztrain 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
tiztrain 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
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 Datanaut !





tiztrain Helper I
Helper I

Re: Sort by another column issue

capture5.png

 

Sorry forgot to mention that I had checked this

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.
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 Datanaut !





tiztrain 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?

tiztrain 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

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.
tiztrain 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
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors