Forum Discussion
Emilie_BRP
Mar 15, 2022Copper Contributor
Pivot table and date sorting/grouped by months/years when empty cells in selected data
Hi, I am just starting to use pivot table and I have to say it si so helpful! I am not able to group my date data per month/year. In my selected column of date I have many empty cells, this seems ...
Donald_Genes_
Mar 15, 2022Brass Contributor
Yes,
Step 1 - Split your Date Column like this
15-March-2022 | Year(Date) | Text(Date, "MMM")
So you should have an helper column in years and Months
Then Load the table to Pivot Table > Drag the Month Field to Rows and Years To Column Fields and Amount to Values Field.
Does your formula for the dates have blanks? For whatever reason, the pivot recognizes a true blank cell differently than a formula that returns "". True blanks don't affect grouping but the formula ones will not allow you to group.
You could try using PowerQuery to do the data cleaning and then your output will have true blanks and thus be able to be manipulated & grouped correctly through a pivot.
Step 1 - Split your Date Column like this
15-March-2022 | Year(Date) | Text(Date, "MMM")
So you should have an helper column in years and Months
Then Load the table to Pivot Table > Drag the Month Field to Rows and Years To Column Fields and Amount to Values Field.
Does your formula for the dates have blanks? For whatever reason, the pivot recognizes a true blank cell differently than a formula that returns "". True blanks don't affect grouping but the formula ones will not allow you to group.
You could try using PowerQuery to do the data cleaning and then your output will have true blanks and thus be able to be manipulated & grouped correctly through a pivot.
- alexcerciAug 20, 2022Copper Contributor
Donald_Genes_ All my blank cells are "true blank", I checked with the function Isblank(), but still not able to group dates. Do you have any suggestions? Thank you in advance- SergeiBaklanAug 20, 2022Diamond Contributor
Do you have dates (which are actually numbers) or texts which looks like dates? You may check by ISNUMBER(). Also, do you have any other texts in Date column?
- alexcerciAug 20, 2022Copper Contributor
SergeiBaklan I have the date column formatted as date. When I insert a pivot table and try to group the dates it tells me the error "cannot group...". I attach here a similar scenario.
- Emilie_BRPMar 21, 2022Copper Contributor
Hi,
thank you very much for your response,
Yes, I have formula and not real blanks, maybe it is my problem, let me try that first.
Power query, don't know this. I have to check if I have it and how it works to put real blanks