How to apply mmm date format to datamodel pivot chart axis?
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"
[link] [comments]
Want to read more?
Check out the full article on the original site