I inserted a pivot table with a named table as the data source, and am using the date value as a Column Label. The dates are either 1/0/1990(blanks), late December 2015, or early January 2016.
I would like to only display dates from 2016, so I used the "Date Filter" to only show values from this year (I tried doing this both by entering the dates manually, and just selecting "This Year").
http://i.stack.imgur.com/VeTO7.png
However when I do this I can now select to see dates "<1/1/2015",any of the months, or ">12/31/2015". Obviously if I want to see items from 2016, this is not much use, as they are all grouped under one "grouping checkbox" (">12/31/2015").
http://i.stack.imgur.com/rmm9y.png
So right now, with all of my 2016 dates falling under January, the only column label visible is ">12/31/2015", instead of showing "Jan".
http://i.stack.imgur.com/L5eza.png
How can I get the pivot table to display the month names for my data, instead of ">12/31/2015"?
http://i.stack.imgur.com/M8IF4.png
The solution that I found (which may not work for everyone), is to check how you grouped your dates, as Excel's automatic grouping incorrectly guessed my date range. Another solution is to make sure you are applying the date filter before you are grouping, instead of after.
Related
I have a column full of specific date and time information, but I want use that data to filter my table to show only MTD, QTD, and YTD rows.
I can't upload an image of my table because of my work computer program, but I have the variable with the dates in the "report filter" field. The data in the column is given as an individual date and time, so that's all I can select when I try to filter it. There's too many option, and I need to be able to select simply QTD, MTD, or YTD dates. How can I do this? Apologies for the lack of imagery.
Select any part of the Pivot table
Under the Analyze tab of the ribbon select Insert Slicer or Insert Timeline whichever you prefer
Filter the dataset based on the criteria you want.
This won't give you your select columns, but without seeing the way you're data is structured should be a good fix.
If you have the issue where the dates won't summarize by month you can create two new columns to summarize the data and create a table with the following columns:
Month # / Month Name
1 January 'you can use whatever naming convention you prefer (jan, etc.)
2 February
....
Then you want to use the MONTH function combined with a VLOOKUP. It should look like =vlookup(month( [date cell reference]), [table you just made], 2, 0) This will pull the month name. Then you can use the YEAR function to get the years. Then make sure the pivot table accounts to the adjusted range and pull those in instead of date. You can still use the slicer and timeline to filter out the dates, but it will be summarized based on these new labels.
I am working to group data in excel and I am trying to sort the input dates by month and week. I've found a number of ways to group by weeks (including grouping the date by 7 days and adding a helper column in the pivot table that numbers the weeks), but I'm having a problem viewing months and weeks without data.
For example, in my data set during the month of October, 2 of the weeks have no input. When I try to make the pivot table "show rows with no data" it shows every week in the year, not only the weeks during the month of October.
I would like be able to show every week during the month of October, including those without data, without showing every week in the year. Has anyone encountered a similar issue? I'm on Excel 2016 but my colleague has the same issue on Excel 2013.
Thanks!
Here is a quick screenshot of the pivot table from the data. I am trying to make all of the weeks in the month of October show up regardless of whether or not there is data, but I don't want to see all of the weeks in the date range. I have sample data input from September 16th, 2018 to January 1st, 2019
Update for anyone looking to do this themselves:
I couldn't figure out a way to do this with Pivot Charts. They lack the ability to group by multiple days as well as by months and years. Instead, I used VBA to select the desired data from the pivot table by checking for the number of the month in each row. (mm/dd/yyyy - mm/dd/yyyy is the format pivot tables use to group days).
I added a dummy row which copied the date ("Date 2") and used that, grouped in 7 days, as the rows for the pivot table. Because I wanted to show items with 0 data I selected that option, which shows every group of 7 days from the first day entered until the last day entered. I used the original Date with Month and Year auto groups to insert Slicers to sort the data.
In VBA you can check which Slicers are selected and use that to determine the range of months you want to display on the inserted chart. This way you can look at one or two months at a time but still show weeks with no data.
While this solution is not particularly elegant, it did allow for a dynamic use of the data that can be adjusted to view specific months or years as was desired. Some useful resources for this method are included below. Again, it is an ugly way to get the desired result but if it works it works!
https://peltiertech.com/referencing-pivot-table-ranges-in-vba/
https://peltiertech.com/create-update-chart-using-partial-pivot-table/
This probably wouldn't count as a programming question, but I'm starting to think it might be a glitch with Microsoft Excel 2016.
My Pivot Table aren't sorting my dates chronologically.
When I toggle the 'Sort Oldest to Newest' in the pivot table, my dates seem to be sorted alphabetically.
Date Revenue
10-Aug $83,004
10-Nov $43,137
10-Oct $881,775
10-Sep $470,486
11-Aug $45,676
11-Nov $250,890
11-Oct $1,324,366
My source data is sorted chronologically no problem.
Source Data sorted nicely:
I have confirmed that my source dates are formatted as Date as well as the format in pivot table. However, I should note, that I can't seem to change the format of the dates on the pivot table. I've Tried the Following:
Opening the 'Value Field Settings Box' by right clicking on the 'Date' field in the Rows > Opening the Format Cells by clicking on 'Number Format' > Selecting Date (and changing the settings from 'd-month' }} This doesn't change the formatting
Highlighting the date column and changing the format to short date in the Number Section of the Home Ribbon }} this also doesn't change the format of the date
In order to confirm that my dates in my source information are formatted as dates, I used the 'Text to Columns' function to be sure that all the dates were pasted as mdy dates. I've also selected the column of dates and right clicked to access format cells as dates. Lastly, I ensured that they registered as dates according to the Number column in the home ribbon.
I thought this was a simple problem, I want my dates in my pivot table to sort chronologically, but it seems to be impossible.
Here is a link to the file for reference.
I am weeks into making my first ever pivot tables, cant believe the power of them but have hit a snag I cannot overcome.
I have a worksheet which has a column with raw data (manually imputed)
Then I have another 2 columns that calculate the difference from the previous month and the % difference. This works fine.
As you can see January 2015 is blank as the difference field is looking for the previous month and January is the first month.
how can I get it to understand to look at December 2014
When there are two different levels of grouping, i.e. Year and Month, it is not possible to get Excel to compare the last item of one group with the first item of the previous group.
Excel treats the additional level of grouping as a different field, which is visible when looking at the PivotTable fields. The Years of the Date show as a separate field:
When choosing to calculate the difference, Excel can only compare to values within the same field. Note that you can compare to a specific month value, but not a specific month of a specific year:
Similarly, Excel can't compare to values from the previous grouping, even though human-logic knows it's the previous value in the overall sequence.
To see the difference between each month across years, it's necessary to have all Year-Months in a single field. This isn't possible using PivotTable grouping on normal dates.
The workaround requires a new field to be added to the data which contains a single value per Year-Month. The PivotTable will then naturally group the data by these Year-Month values.
There are two ways this can be achieved:
Calculate the first day of each Year-Month
Insert another column with this formula (referring to a date in the A2 cell):
=Date(Year(A2),Month(A2),1)
This performs the grouping before the data goes into the PivotTable by treating every date as the first of the month. In the PivotTable, the full date will appear by default. You can apply Custom Number Formatting to the field to display only the Month and Year, for example: "mmm yyyy"
This is a better solution when grouping by months as it allows more formatting options.
Calculate a text value for each Year-Month
Insert a column with this formula:
=TEXT(A2,"yyyy mm")
For example, the following data:
Can generate this PivotTable (with sums and then differences):
The text solution has the drawback that you must specify the Year and then Month numerically (and padded to 4 and 2 digits respectively) if you want the PivotTable to automatically order the values in chronological order.
The benefit of the text solution is greater flexibility. For example, you could group bi-monthly with more advanced formulas or group two fields of actual data together by concatenation.
Have you tried combining the month and year in one cell? So on the source data, in the month column have:
Aug-14
Sep-14
Oct-14
Nov-14
Dec-14
Jan-15
Instead of having one column for month name and one for year.
Make sure that once you input the months in your raw data tab, they go to the right side of the cell meaning that Excel sees them as dates not text.
I'm using Powerpivot to create a pivot table in Excel.
In Powerpivot,the Date_Received column is correctly formatted as Date (dd/mm/yyyy) and all of the date columns are working correctly in Powerpivot. However when I try to summary data by pivot table in excel, all the date columns are converted to text and behave as text in pivottable.
Consequently, I can't not group the result by Year, Month... or even sort data from Oldest to Newest.
I think it is a very common problem with Powerpivot, could someone please help?
My guess is that you are UK based? It's a well known and long standing issue that is connected to PowerPivot failing to properly understand the date format.
There are some things you need to do to get round this:
Use a separate date table that has a column of unique, continous dates that cover your required period. Each other table with dates should be linked to this.
In the PowerPivot window on the 'Design' tab mark this as your date table with your date column as 'the date'
Change the format of this date column in the PowerPivot window to something that is non ambiguous - I tend to use yyyy-mm-dd.
At this point any pivot you create using this column will be sortable by date and the date filters will become available.