Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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

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
PattemManohar
Community Champion
Community Champion

@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 PBI Community Champion




capture5.png

 

Sorry forgot to mention that I had checked this

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.

@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 PBI Community Champion




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?

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

capture7.png

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.

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

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.