I have a problem: I'm doing automated pivots monthly development created from different tables. Some contain at least one entry for each month, some don't. The ones that are missing the month (one of the months is simply not written in the month column) then also don't show up in the created PivotTable. I don't want to add any artificial rows to the source data. So my question is, is there any way to use vba to create a fixed list of column labels, to which I can then associate the data from the months column of the source data, so that all months are displayed, even those without records.
Have this:
Want this:
I have already tried a solution via creating a pivot from the data model, however I need the source to still be the actual source data, not some external data. Another option was to create a relation between the source table and another one with all the months, however this didn't work either and even when I put the list of months from the other "auxiliary" table into the columns in the pivot, the months columns without relevant data were hidden again.
If you don't want to use a full calendar table, then your solution with the auxiliary table containing all months is the right one.
In the data model, you shall then link it to all your month columns in other tables and use it in pivot tables as you already tried (you should ideally hide month columns from other tables in Power Pivot).
But then, what remains to be done is to right-click on the pivot table => "Pivot table options...", go within tab "Display" and check "Show items with no data on columns".