Grouping pivot table dates by month and year breaks on reload

My raw sales data has specific dates for each purchase; I made a pivot table, and then grouped the dates by month and year, which creates categories and subcategories in the resulting table. Then I make a chart showing the data, and it visually groups the x-axis very nicely by year and then by month. All hunky-dory.

Now I reload the file, and the table is broken: now each year has 13 rows instead of 12, with a blank row (except for the year number) at the start of each year. Wouldn’t be such a big deal, except (a) it breaks the chart, which still has the same range of cells as it did before – it treats the blank rows as empty spaces in the data, and cuts off the data at the end. And (b) in expanding, the chart just overwrites anything that was in the spaces below it.

To add insult to injury, when I try to redefine the data and label ranges for the chart (using multiple ranges separated by commas) it groups January of 2025 as if it’s the thirteenth month of 2024 for some reason.

This problem is consistent across .ods and .xlsx file formats and I don’t know how to fix it. (.xls has the additional problem that I can’t make it group by month and year in the first place, but one problem at a time.)

First things first,

Please paste here the information in Menu>Help>About LibreOffice.

(There is an icon in the center to copy the information).

Please attach a sample file, reduced as much as possible, without private information.

Excel Sample - Coffee Sales.xlsx (212.2 KB)

Here’s the file. It’s based on a data set from Kaggle so no worries about sensitive info. Monthly Revenue is the offending pivot table and chart; obviously I can’t show you what it’s supposed to look like. Version info should be the latest:

Version: 26.2.5.2 (X86_64)
Build ID: cd7284b4cbbfeb507e630c1aac019f4157393acb
CPU threads: 8; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: en-CA (en_CA); UI: en-US
Calc: CL threaded

I am not sure what is happening on your computer. I can see the empty row in the pivot table, but if I go into Properties, drag the Years out of the Row Fields, OK, then go back in and drag it back into the Row Fields, OK and Save, it remains displayed correctly, that is, no empty rows.This is for both .xlsx and for .ods

1 Like

PIVOT_xlsx

2 Likes