2 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

How to apply mmm date format to datamodel pivot chart axis?

Our take

If you're looking to display dates in the "mmm" format on a data model pivot chart while maintaining chronological order, you’re not alone. Many users encounter challenges with formatting in pivot charts, particularly when using Power Query to load data. The data model typically lacks an option for the "mmm" format, and standard number formatting often fails to reflect in the pivot chart. This guide will explore effective strategies to achieve the desired date format, ensuring clarity and functionality in your visual data presentations.

I'm using pivot charts to display data by month. All of my data is loaded into the data model with powerquery. I need to show the date as mmm, but also preserving the chronological sort order. So I have a table with a record for each month with the first day of the month as a date value.

I don't have any grouping on this field or in any other tables. The data model doesn't have an option for the mmm format, and doesn't seem to do anything to the pivotables anyway. I can't find an option to set a number format for the field in the field settings. Defining the number format for the column of cells on the pivot table doesn't change the pivot chart. I tried to change the number format of the chart axis, but cant get it to apply.

Somehow I was able to do this with one pivot table and chart, but I couldn't replicate it. Removing the date from this pivot table and re-adding it also removes the mmm format.

Is there a known proper way to do this?

I was eventually able to set the number format in a table and chart with vba.

ActiveSheet.PivotTables("PivotTable1").CubeFields("[fPeriodRef].[Day1]").PivotFields(1).NumberFormat="mmm"

submitted by /u/MJ0865
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article

Related Articles