cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
tiztrain Regular Visitor
Regular Visitor

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 Regular Visitor
Regular Visitor

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
Super User

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 Regular Visitor
Regular Visitor

Re: Sort by another column issue

capture5.png

 

Sorry forgot to mention that I had checked this

v-cherch-msft Super Contributor
Super Contributor

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
Super User

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 Regular Visitor
Regular Visitor

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 Regular Visitor
Regular Visitor

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

v-cherch-msft Super Contributor
Super Contributor

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 Regular Visitor
Regular Visitor

Re: Sort by another column issue

I was still wondering if there is a better way to do it?
v-cherch-msft Super Contributor
Super Contributor

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
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 79 members 1,403 guests
Please welcome our newest community members: