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

Calendar Sorting Problem

I previously had a problem trying to get my data to sort correctly based on one field while displaying another field in the line graph widget

https://community.powerbi.com/t5/Desktop/Sort-by-another-column-issue/m-p/550420#M258958

 

I was able to figure out that by adding the field I wanted to sort by into the Tooltips, I was able to sort the chart correctly.

 

The issue that I have now is when I try to sort by the field Month Year Number (which has also been added to the tooltips), it does not display in order.

 

 capture1.png

 

capture2.png

 

My calendar is still:

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)
)

 

My calendar table still looks correct to me:

capture3.png

 

By hovering over the data to see the tooltip I have realised that BI sums the table together in this chart:

capture4.png

 

capture5.png

 

But on my previous chart from my original post, the field in the tooltips does not get added together:

capture6.png

 

I am a bit lost to what the difference is?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Calendar Sorting Problem

Hi @tiztrain,

 

You can refer to following blog to know how to create a custom sort table with 'sort by column' feature to manually apply sort order of specific column:

Custom Sorting in Power BI

 

Regards,

Xiaoxin Sheng

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



For learning resources/Release notes, please visit: | |
4 REPLIES 4
CheenuSing Super Contributor
Super Contributor

Re: Calendar Sorting Problem

Hi @tiztrain,

 

 

Did you try sorting the MonthYearText column by MonthNumber.

 

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!
tiztrain Regular Visitor
Regular Visitor

Re: Calendar Sorting Problem

Yes I did.

 

As I highlighted in the original post, Sort by Column in the Modeling tab did not work.

 capture7.png

 

The only way to get it to work with my other chart was to add the field in the tooltip section and then sort by

capture1.png

Community Support Team
Community Support Team

Re: Calendar Sorting Problem

Hi @tiztrain,

 

You can refer to following blog to know how to create a custom sort table with 'sort by column' feature to manually apply sort order of specific column:

Custom Sorting in Power BI

 

Regards,

Xiaoxin Sheng

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



For learning resources/Release notes, please visit: | |
tiztrain Regular Visitor
Regular Visitor

Re: Calendar Sorting Problem

Argh legend!

I had everything setup correctly but the part I was missing was:

 

Now Exit the Query Editor>>>Go to DATA view >>>Select the ITEMS column in the New Table>>Go to Modelling Tab>>Sort by Column>>Select Index

 

Thank you!

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 63 members 1,410 guests
Please welcome our newest community members: