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

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

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
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
CheenuSing
Community Champion
Community Champion

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!

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

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
If this post helps, please consider accept as solution to help other members find it more quickly.

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