98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » How to Group dates in PowerPivot
How to Group dates in PowerPivot
Resolved · High Priority · Version 2013
Tsudoi has attended:
Excel PowerPivot course
Excel VBA Introduction course
How to Group dates in PowerPivot
Hi,
I cannot seem to be able to group/ungroup dates in Rows in powerpivot. I would like to group dates in Month.
How do I do that please?
Thanks,
RE: How to Group dates in PowerPivot
Hi Tsodui,
Thank you for the forum question.
We are working with a data model when we are working with PowerPivot. Microsoft has integrated database technology in Excel. The whole idea with PowerPivot is that it can handle data cubes (multi dimension data) and we have to please Excel to get it right.
The tables should be normalised (all data in one table should be a fact of the primary key (the unique record identifier, which we use in the relationship to other tables in the data model)).
As we did on the course. If you want to work with dates in your report, you will need a date table in a external workbook, where the primary key is all the dates starting from the date you want to start your report/PivotTable from and a end date some years into the future.
Type Dates in A1 in the worksheet. Type 1/1/2010 in A2. Drag down the fill handle as far as you want. Type Month in B1. Type =Month(a2) in B2 and double click the fill handle.
Then you will need to add as many columns as you need. If you want to group your report on quarters you will need a column extracting the quaters from the dates (primary key). If you want to group by year you must have a column extracting the year from the primary key.
Import the date table to your data model and relate the primary key to a date in your table.
If you in the pivottable add month from your imported date table Excel will group your data on month.
When you are using DAX measures, which need a date you must reference the primary key in the date table.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
RE: How to Group dates in PowerPivot
Hi,
I added Date Table and successfully made relationship and bringing in the primary key but it still does not give me option to group/ungroup (grayed out).
What I want is not to bring Month from Date Table but to group dates inside the pivot table.
I hope that makes sense.
Regards
RE: How to Group dates in PowerPivot
Hi Tsudoi,
In the pivot you must take month from the date table not the transaction table.
You can only group your PowerPivot tables if you take the field from the dim table. If you in the future need to group your report on product you will most likely need a dim table with your products.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
RE: How to Group dates in PowerPivot
Sorry I might have misused the term Primary Key.
I am bringing Dates from Date Table (Dim), not Sales (Trans)
Still grayed out and not possible.
Regards
RE: How to Group dates in PowerPivot
Hi Tsudoi,
You have to bring in the month from the date table not the date. You cannot group anything in PowerPivot tables from the PivotTable ribbon group you need to group from your dim tables.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
RE: How to Group dates in PowerPivot
Hi Tsudoi,
Your tables must be organised as Lookup tables (dim tables) and transaction tables (fact tables).
A lookup table could be a product table where you have all your products identified by a product ID (the primary key). The table should have all the product properties (price, colour etc.). A fact table could be all the transactions. Product id (to identify which product you have sold), Quantity, sales date, discount all information for each transaction.
Then the tables can be related from the Product id from the product table to the product id in the transaction table and you will have a data model, where the dax measures can handle the cube array calculations.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
RE: How to Group dates in PowerPivot
Hi,
I understand that. Dim table (=lookup table) for Dates and Fact table (sales, margins etc) are both fine and the pivot table works using some measures I've made. It's only that I cannot group the dates by month on the pivot table, hence my problem.
Regards
RE: How to Group dates in PowerPivot
Hi Tsudoi,
If you have added the field month from the date table (make sure you do not have the date added to the pivottable from your fact table) to your PowerPivot table and Excel cannot group your data on the months, you have a problem with your data model or your DAX measures.
Based on the information I have got from you I cannot unfortunately tell you where you have the problem.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
RE: How to Group dates in PowerPivot
Hi,
OK that's fine.Thanks for trying anyway.I will try it more myself.
Regards
RE: How to Group dates in PowerPivot
Hi Tsudoi,
I am sorry that I couldn't help you but I hope you find a solution.
ind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Adding Rows or Columns in an Excel 2010 WorksheetIf you want to add a row to an Excel spreadsheet, these are the simple steps you should take: |