Forum Discussion
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
- PattemManoharCommunity Champion
tiztrain Can you please check and confirm whether the "Date Month Number" field is "Whole Number" Data Type or not.
- tiztrainHelper I
Sorry forgot to mention that I had checked this
- v-cherch-msftMicrosoft Employee
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