Forum Discussion

tiztrain's avatar
tiztrain
Helper I
7 years ago
Solved

Sort by another column issue

So currently I am trying to display the date and month in order but get the following:

 

 

 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:

 

And have tried selecting the line chart then selecting the field and clicking on Sort by Column:

 

Does not help and the line chart stays the same.

 

This is what the calendar table looks like:

 

Can anybody provide me with some help as what I am doing wrong here?

 

 

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

9 Replies