Pivot chart doesnt sort custom date correctly

Guinaba

Board Regular
Joined
Sep 19, 2018
Messages
233
Office Version
  1. 2016
Platform
  1. Windows
Hi experts,

I need the following format on my date "dd/mm/yyyy ddd" (31/12/2021 Sun) so I am using the format function on powerpivot to get the date in that format, however when I do that, my chart doesn't sort the date correctly. See pic below


Incorrect sorting using custom date format:

1629070106714.png


Correct sorting using standard date format:
1629070196356.png
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Check if the field/axis on the chart is marked as text rather than date.
It seems to be sorted as text.
 
Upvote 0
Check if the field/axis on the chart is marked as text rather than date.
It seems to be sorted as text.
Hi @bobsan42,

Correct is marked as text, that is the issue, however not sure, how to add that format and keeping the field as date.
 
Upvote 0
Using the format function you have turned your date data into strings (text). Excel offers plenty of formatting options so don't be too quick to get rid of the native data.
To keep the dates ditch the format function, but use the Custom Number format option.
Formatting the date like this will be something like: dd/mm/yyyy ddd
The other option if you have to use string data is to format it in the reverse order: yyyy/mm/dd - then at least the sorting will be correct.
 
Upvote 0
Using the format function you have turned your date data into strings (text). Excel offers plenty of formatting options so don't be too quick to get rid of the native data.
To keep the dates ditch the format function, but use the Custom Number format option.
Formatting the date like this will be something like: dd/mm/yyyy ddd
The other option if you have to use string data is to format it in the reverse order: yyyy/mm/dd - then at least the sorting will be correct.
@bobsan42 I did that in PowerPivot (pic below), however not sure why the chart is not picking up the format, neither the slices.

1629110056187.png
 
Upvote 0
Did you change the field name. Try to rebuild the chart. And check again the date/text axis property.
 
Upvote 0
Hi @bobsan42, I recreated the chart and pivot, I can see the date ok on the table but in the chart, maybe there is a limitation on the chat to display the same format.
1629110982717.png
 
Upvote 0
You can define your custom number format for the axis numbers/labels of the chart.
However for this to actually work you have to turn OFF Date groupint for the row labels (dates) of the pivot table/chart. Otherwise the dates are converted to text.

Check this article:
How to Change Date Formatting for Grouped Pivot Table Fields - Excel Campus
and specifically the section Automatic Date Field Grouping.
 
Upvote 0
Thanks @bobsan42! That's really a good article, I'll try some of the options and see how it goes. I'll let you know.
 
Upvote 0

Forum statistics

Threads
1,223,703
Messages
6,173,941
Members
452,539
Latest member
delvey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top