Using the Data Model to Create Pivot Tables: 1-Hour Tutorial!
Résumé
TLDRIn this informative webinar, Deborah Ashby teaches attendees how to utilize the data model in Excel to create advanced pivot tables. The session begins with a brief review of basic pivot table creation and emphasizes the benefits of integrating multiple data sources through the data model. Important concepts such as importing data using 'Get and Transform,' utilizing Power Query for data cleaning, and establishing relationships between tables are explored. Participants learn how to create a pivot table from combined datasets, use descriptive fields for better interpretation, and incorporate pivot charts. The session concludes with a demonstration of efficiently updating pivot tables when new data is added, highlighting the structured process of maintaining ongoing analyses with ease. A variety of techniques are discussed, making the content valuable for users at different expertise levels.
A retenir
- 📊 Understand the importance of the data model in Excel.
- 💡 Learn to create pivot tables from multiple data sources.
- 🔗 Establish relationships between different tables.
- 🛠️ Use Power Query for importing and transforming data.
- 🔄 Easily update pivot tables with new data.
- 📂 Link to a folder for efficient data management.
- 📈 Create meaningful pivot charts from your data.
- 📝 Name your tables meaningfully for better organization.
- 🎓 Ideal for both beginners and advanced users.
- 🗨️ Interactive Q&A for participant engagement.
Chronologie
- 00:00:00 - 00:05:00
The webinar introduces the concept of using the data model to create a pivot table, following a previous session on basic pivot table creation. Deborah Ashby explains that while prior knowledge of pivot tables is helpful, it's not necessary for attending this session, and offers a quick recap of creating a basic pivot table from a single data source.
- 00:05:00 - 00:10:00
Deborah demonstrates creating a basic pivot table using a sales data file that includes information about orders, customers, and salespersons. She emphasizes the importance of formatting data as an Excel table, which simplifies the pivot table creation process. Deborah creates a pivot table using this single data source, highlighting its limited analytical capability compared to utilizing multiple data sources.
- 00:10:00 - 00:15:00
The session transitions to understanding the data model's purpose. Deborah outlines that the data model is essential for analyzing data from multiple sources, illustrating the difference between single-source pivot tables and those generated from a data model. The agenda includes combining files to enhance analysis, using Power Query for data management, and creating consolidated pivot tables.
- 00:15:00 - 00:20:00
Deborah opens transaction files for 2019 and 2020 to illustrate the consistency between their data structures. She explains the limitations in analysis due to the generic transaction data and the necessity of pulling in additional data related to accounts and products for a more meaningful analysis.
- 00:20:00 - 00:25:00
To create a more effective pivot table, Deborah explores how to combine transaction data from two years while ensuring data consistency across files. She offers insight into setting up a folder structure for ease of updating with additional transaction files in the future, emphasizing the power of having a well-organized data model.
- 00:25:00 - 00:30:00
Using Excel's Power Query, Deborah demonstrates how to import data from the folder containing transaction files. She explains the process of combining these two transaction data files in Power Query, demonstrating how to clean and prepare data efficiently, leading to a consolidated view suitable for pivot table creation.
- 00:30:00 - 00:35:00
After combining transaction data, Deborah adds additional tables (accounts and products) into the data model, elaborating on how to link different tables using common fields. She explains the necessity of creating relationships between tables for effective pivot table analysis, highlighting the importance of having a structured data model.
- 00:35:00 - 00:42:46
The session concludes with Deborah demonstrating how to create a pivot chart using the data model and subsequently updating it with new transaction data. She illustrates how the connection to the folder allows for straightforward updates to pivot tables and charts with minimal effort, showcasing the efficiency of a well-structured data model.
Carte mentale
Vidéo Q&R
What is the focus of this webinar?
The webinar focuses on using the data model to create pivot tables in Excel.
Is prior knowledge of pivot tables required for this session?
No, but a basic understanding will be helpful.
What software is this training about?
This training is about Microsoft Excel.
What is the data model?
The data model is a way to analyze data from multiple sources using pivot tables.
How can I update my pivot tables when using a data model?
You can quickly update pivot tables by refreshing them after adding new data files to the connected folder.
What user-friendly tool is introduced during the session?
Power Query is introduced for transforming and cleaning data.
What is one main advantage of using the data model?
The data model allows combining data from multiple tables into a consolidated pivot table.
Voir plus de résumés vidéo
- 00:00:00[Music]
- 00:00:01Simon Says subscribe and click on the
- 00:00:05Bell icon to receive notifications
- 00:00:09welcome thank you so much for joining us
- 00:00:12this month for today's webinar which is
- 00:00:15using the data model to create a pivot
- 00:00:17table and this is actually a really nice
- 00:00:21follow-on session from the webinar that
- 00:00:23we did last month where we took a look
- 00:00:26at basically creating pivot tables from
- 00:00:28scratch always a popular topic now if
- 00:00:31you didn't attend last month don't worry
- 00:00:33at all it isn't a prerequisite to be a
- 00:00:36to be able to follow this particular
- 00:00:38session but I will say that if you do
- 00:00:40have a basic knowledge of pivot tables
- 00:00:42then this is going to help you out a lot
- 00:00:43in this session as we go through it I am
- 00:00:46going to do a quick recap of creating a
- 00:00:49basic pivot table not using the data
- 00:00:51model at the beginning so that will give
- 00:00:54you it will be very brief but it will
- 00:00:56give you a bit of an idea if you're not
- 00:00:58used to creating pivot tables or not as
- 00:01:00familiar with that now the reason why
- 00:01:02I'm going to start out with just
- 00:01:04creating a basic pivot table is because
- 00:01:05it illustrates really nicely why we
- 00:01:08might want to use the data model to
- 00:01:10create our pivot tables instead
- 00:01:13now before we get on to all of that I do
- 00:01:16have quite a bit of housekeeping today
- 00:01:18so let's run through that very quickly
- 00:01:20now for those of you that are new to our
- 00:01:23training sessions I know we do get a lot
- 00:01:25of regulars so I apologize if you see
- 00:01:28this every single month but for anybody
- 00:01:30who is new let me just introduce myself
- 00:01:32so my name is Deborah Ashby and I'm our
- 00:01:35it trainer and Microsoft subject matter
- 00:01:38expert and I've been a trainer for a
- 00:01:40pretty long time about 16 years now and
- 00:01:43I've worked in the The Wider IT industry
- 00:01:46not necessarily in training for a total
- 00:01:48of about 25 years it always makes me
- 00:01:51feel really old when I say that and it
- 00:01:54is my absolute pleasure to be hosting
- 00:01:55this webinar for you today on my
- 00:01:58favorite subject which is basically
- 00:01:59Excel pivot tables I am going to provide
- 00:02:02you with the files that I'm going to be
- 00:02:04using throughout this session and I know
- 00:02:06a lot of people do find
- 00:02:08um do you find that I go through a bit
- 00:02:10too quick for them in the webinar and
- 00:02:12they like to go back and re-watch it at
- 00:02:14their own pace with the course files so
- 00:02:16I definitely encourage you to do that if
- 00:02:19you want to
- 00:02:20and for this specific lesson there's
- 00:02:23quite a few files and the way that you
- 00:02:25save them is going to be quite important
- 00:02:28this if you can see my desktop just here
- 00:02:30I have a folder here called transaction
- 00:02:32data if I double click inside that I
- 00:02:35have transactions 2019 2020 and then I
- 00:02:38have the other files that we're going to
- 00:02:40be using outside of that folder simply
- 00:02:42on my desktop what I want to do now is
- 00:02:45just quickly walk you through today's
- 00:02:46agenda what are we going to do with all
- 00:02:48of those files that we've just
- 00:02:50downloaded
- 00:02:51well the first thing we're going to do
- 00:02:53is we're going to talk about what
- 00:02:55exactly is the data model and why do we
- 00:02:58use it now I found that the best way to
- 00:03:00understand this is to start with a basic
- 00:03:02example of a pivot table report so again
- 00:03:05if you attended the session last month
- 00:03:07then we ran through pivot tables but in
- 00:03:10this I am going to show you how we can
- 00:03:11build a basic pivot table report and
- 00:03:14during that I'm going to show you the
- 00:03:16difference between doing a basic pivot
- 00:03:18table report from one data source and
- 00:03:21using the data model
- 00:03:23what we're then going to do is we're
- 00:03:24going to open up some of those files
- 00:03:26that I've sent through to you so that we
- 00:03:28can understand exactly what we're
- 00:03:30looking at the data that we're using and
- 00:03:32why we're using so many different files
- 00:03:34in this session
- 00:03:36we're then going to move on to importing
- 00:03:38our data in using get and transform and
- 00:03:41I'm going to show you how you can link
- 00:03:43to a specific folder which is going to
- 00:03:46make your life a lot easier when it
- 00:03:47comes to adding data to and updating
- 00:03:50your pivot tables later on
- 00:03:53we're going to talk a little bit about
- 00:03:54the power query editor we're not going
- 00:03:56to linger too much on that because it is
- 00:03:58an entire Topic in its own right but we
- 00:04:01will take a quick look at that I'm going
- 00:04:03to show you how you can do things like
- 00:04:04combine multiple files together and then
- 00:04:06how you can add data to the data model
- 00:04:10we're going to take a look at creating
- 00:04:12relationships between different tables
- 00:04:14of data and then how we can use all of
- 00:04:17our data to create what we call a
- 00:04:19Consolidated pivot table
- 00:04:21we're going to finish out the session by
- 00:04:23creating a pivot chart based off of the
- 00:04:25data model and then I'm going to show
- 00:04:27you how easy it is to update the data
- 00:04:30now if you've never used data models
- 00:04:32before then most of that agenda is
- 00:04:34probably not going to make too much
- 00:04:35sense to you things like get and
- 00:04:37transform power query combining you know
- 00:04:40what does this all mean it is going to
- 00:04:42become clear as we work our way through
- 00:04:46so let's start out with that first
- 00:04:48initial question what is the data model
- 00:04:50and why do we use it now as I said to
- 00:04:53illustrate this we're going to start out
- 00:04:56by building a basic pivot table report
- 00:04:58and we're going to use one of the files
- 00:05:01that we've downloaded
- 00:05:03so I'd like you to go to your desktop
- 00:05:06and first of all open up the file called
- 00:05:09sales2020.xlsx
- 00:05:13yes
- 00:05:14and it's this one just here
- 00:05:19so I'll just give you a couple of
- 00:05:21seconds to orientate yourselves because
- 00:05:23a lot of information in the first five
- 00:05:25minutes
- 00:05:29all right
- 00:05:30so once you've got that open this is
- 00:05:32basically just some data that relates to
- 00:05:35different sales so we've got in column A
- 00:05:37we have order ID then we have customer
- 00:05:39ID trip name so this is sales data
- 00:05:42related to holidays to different trips
- 00:05:44we have the sales person responsible for
- 00:05:47that sale the trip price and the
- 00:05:49quantity that they sold of that trip so
- 00:05:51some very basic data now if I wanted to
- 00:05:54analyze this data of course I could put
- 00:05:57this into a pivot table
- 00:06:00and currently this data that I'm using
- 00:06:02is all coming from One Source it's all
- 00:06:04here in this spreadsheet that I have
- 00:06:06open
- 00:06:07so let's just walk through the process
- 00:06:09of creating a basic pivot table so you
- 00:06:11can understand why we might use the data
- 00:06:13model instead
- 00:06:15so the first thing I'm going to do here
- 00:06:17is this data is completely unformatted
- 00:06:19I've tidied it up a little bit it's
- 00:06:21quite neat but I'm going to put it into
- 00:06:23an Excel table first this is my biggest
- 00:06:26top tip always put data sets into an
- 00:06:29Excel table there are many advantages to
- 00:06:31doing this now a quick way to create an
- 00:06:34Excel table is to click anywhere in your
- 00:06:36data and press the Ctrl T keyboard
- 00:06:39shortcut
- 00:06:40you can see I've got my martians around
- 00:06:43the outside of my data set that is the
- 00:06:45data I want to use I want to make sure
- 00:06:48that I have a tick in my table has
- 00:06:49headers I click on OK and I've created
- 00:06:52myself an Excel table if you don't
- 00:06:55particularly like your table style
- 00:06:57remember you can change it from here to
- 00:06:59something a bit more pleasing to your
- 00:07:01eye let's go for a nice orange color
- 00:07:04so now that we've created a table we
- 00:07:06have our table design contextual ribbon
- 00:07:09again what I always advise people to do
- 00:07:11when they're creating Excel tables is to
- 00:07:14make sure that you give your table a
- 00:07:15meaningful name it just helps you
- 00:07:17identify your table
- 00:07:19if we take a look at the first group on
- 00:07:23this table design ribbon you can see it
- 00:07:25says table name is currently table one
- 00:07:27that's a bit too generic so let's call
- 00:07:30this sales underscore
- 00:07:332020 and hit enter remember you can't
- 00:07:36have any spaces in your table name so it
- 00:07:40either has to be one word or separated
- 00:07:42with an underscore
- 00:07:44so I always do that before I put my data
- 00:07:46or before I analyze my data in a pivot
- 00:07:49table
- 00:07:50so at this stage this is where I might
- 00:07:52convert this to a pivot table again a
- 00:07:54couple of different ways that I can do
- 00:07:56this I can go on to the insert ribbon go
- 00:07:59to Pivot tables and choose from table
- 00:08:01range or because I'm already on that
- 00:08:04table design ribbon when I'm renaming
- 00:08:06the table I can choose summarize with
- 00:08:09pivot table from here
- 00:08:11now this is where it gets a little bit
- 00:08:13more interesting So currently it's
- 00:08:16telling me that it's going to create my
- 00:08:17pivot table based off of my table range
- 00:08:20and you can see it's picked up the name
- 00:08:22of my table sales underscore 2020 which
- 00:08:25in this case is exactly what I want it
- 00:08:27to do
- 00:08:28I can then choose where I want to put
- 00:08:30this pivot table so do I want to put it
- 00:08:32on a new worksheet or do I want to put
- 00:08:34it on the existing worksheet again my
- 00:08:37recommendation is always separate your
- 00:08:39pivot tables from your Source data so
- 00:08:42I'm going to keep mine on new worksheet
- 00:08:45now normally at this stage I would just
- 00:08:47click on OK and off we would go creating
- 00:08:50a pivot table
- 00:08:51but take a look at this bottom option we
- 00:08:54also have an option to add this data to
- 00:08:57the data model and take out take a look
- 00:09:00at the heading just above there it says
- 00:09:02choose whether you want to analyze
- 00:09:04multiple tables and this is the
- 00:09:08difference you would use the data model
- 00:09:10if you want to analyze data from
- 00:09:14multiple sources so in this example all
- 00:09:18of the data I want to analyze is
- 00:09:19contained within this table range One
- 00:09:22Source but what if I wanted to analyze
- 00:09:25data from lots of different tables maybe
- 00:09:27other tables in this worksheet or maybe
- 00:09:30other tables in other workbooks maybe I
- 00:09:34want to bring them all together and be
- 00:09:36able to analyze all of the different
- 00:09:38fields in one pivot table that is where
- 00:09:42we would use the data model so think
- 00:09:44about this as a way to analyze multiple
- 00:09:47sources of data and build a Consolidated
- 00:09:50pivot table
- 00:09:53so bear that in mind let's just quickly
- 00:09:55create a pivot table
- 00:09:58from this one data source so I'm not
- 00:10:00going to add it to the data model I'm
- 00:10:01just going to say new worksheet and
- 00:10:03click on OK
- 00:10:04so here this is your standard pivot
- 00:10:06table it's created a new sheet at the
- 00:10:09bottom I have my blank pivot table
- 00:10:11report and it's populated it over here
- 00:10:13with my pivot table fields and these are
- 00:10:16effectively just the column headings
- 00:10:18from my data source I then have the four
- 00:10:21areas and I can simply drag and drop my
- 00:10:24headings into these different areas to
- 00:10:26build my pivot table that is effectively
- 00:10:28all a pivot table is so it's very easy
- 00:10:31for me to do an analysis here so maybe I
- 00:10:33want to see how many trips each sales
- 00:10:36person has sold I could drag sales
- 00:10:39person into rows like a drag trip price
- 00:10:42into values and very quickly I've done
- 00:10:44an analysis just there
- 00:10:46I could remove salesperson and maybe I
- 00:10:49want to see This Time by trip name I
- 00:10:51could drag that into rows I could even
- 00:10:54add salesperson into columns to get a
- 00:10:56completely different way of analyzing
- 00:10:58this data that is a basic pivot table
- 00:11:02we're using one source of data in order
- 00:11:05to perform our analysis okay so that's a
- 00:11:09quick recap on pivot tables and
- 00:11:12hopefully there you can see the
- 00:11:14difference data model is when we want to
- 00:11:16use multiple sources as opposed to one
- 00:11:21so with all that in mind let's close
- 00:11:25down this particular worksheet because
- 00:11:27we're going to take a look at some of
- 00:11:29the files that we're going to be using
- 00:11:30so you can understand what we're doing
- 00:11:33now if you recall I asked you to create
- 00:11:36a folder on your desktop it's this one
- 00:11:38just here I've called mine transaction
- 00:11:40data let's double click to open this up
- 00:11:43and in there we should find we have two
- 00:11:47files transactions 2019 and transactions
- 00:11:5020 20.
- 00:11:52now what I'm going to do here is I'm
- 00:11:54just going to open up
- 00:11:56both of these and I'm going to put them
- 00:11:58in a split screen format so they're a
- 00:12:01bit easier to compare side by side
- 00:12:03so let's open up both of them
- 00:12:07and put them
- 00:12:10put them next to each other just there
- 00:12:13now the first thing you'll notice about
- 00:12:15these two files is that they are
- 00:12:17consistent in the way that they're laid
- 00:12:19out so you can see that each of these
- 00:12:21files holds transaction data but they're
- 00:12:24just for different years
- 00:12:26so for this one here in column A this is
- 00:12:28the transaction data for 2019. and this
- 00:12:32one here in column A is the transaction
- 00:12:34data for 20 20.
- 00:12:36all of the column headings
- 00:12:39I apologize for that motorbike going
- 00:12:40past all of the column headings are
- 00:12:43exactly the same so we have date uh
- 00:12:46transaction ID product number account
- 00:12:48number and amount and that is consistent
- 00:12:50across both of these files
- 00:12:52so maybe what I want to do is create a
- 00:12:55pivot table where I can use all of this
- 00:12:58data but my data is split across two
- 00:13:00different files transactions 2019 and
- 00:13:03transactions 20 20. now because this
- 00:13:06data is consistent in its columns what I
- 00:13:09could do here is I could combine both of
- 00:13:11these files into one big file and then
- 00:13:15analyze that data which is exactly what
- 00:13:18we're going to do
- 00:13:20now something else that I might want to
- 00:13:22do here is if we take a look at the data
- 00:13:25that we have in here it's not
- 00:13:26particularly meaningful in these two
- 00:13:28files I have transaction IDs which are
- 00:13:31just random numbers I have product
- 00:13:33numbers I have account numbers so on and
- 00:13:35so forth
- 00:13:37I was doing a pivot table based off of
- 00:13:39this data it's not going to be really
- 00:13:41very meaningful because what I might
- 00:13:43have here is a pivot table that shows me
- 00:13:45the product number and then the amount
- 00:13:48what would be more meaningful is if I
- 00:13:51had the product name as opposed to the
- 00:13:53product number
- 00:13:55what might be more meaningful is if I
- 00:13:57had the account name as opposed to the
- 00:14:00account number but that data doesn't
- 00:14:02actually exist in either of these two
- 00:14:05files
- 00:14:06however we do have some other files that
- 00:14:09contains this data
- 00:14:11so let's just minimize these down
- 00:14:13and take a look at the other files that
- 00:14:16I sent through now the first one we're
- 00:14:18going to open is this one here it's
- 00:14:20called
- 00:14:21accounts.xlsx let's double click and
- 00:14:24take a look at this
- 00:14:27now what we have in here is a very small
- 00:14:31spreadsheet that shows me the account
- 00:14:33number and the accounts that that
- 00:14:35relates to so if I put this side by side
- 00:14:38with one of one of our transaction files
- 00:14:40you can see in the account number column
- 00:14:43we're only going to have one of four
- 00:14:45numbers in here it's either going to be
- 00:14:47five thousand six thousand seven
- 00:14:49thousand or eight thousand but these
- 00:14:51account numbers relate to these specific
- 00:14:54accounts
- 00:14:56the same thing occurs with the products
- 00:14:59spreadsheet as well so if we open this
- 00:15:02one up and take a look at what we have
- 00:15:04in there
- 00:15:06are you being slow XL or did I not click
- 00:15:08there we go
- 00:15:11once again we have just a very small
- 00:15:13table that shows the product numbers
- 00:15:15which relates to the product number
- 00:15:17column in the transaction spreadsheet
- 00:15:19and the actual meaningful products that
- 00:15:22those numbers relate to
- 00:15:24so if I want to build a big meaningful
- 00:15:26pivot table that's going to make sense
- 00:15:28to my stakeholders and to my CEO and
- 00:15:30whoever else who wants to read this data
- 00:15:33I want to combine all of these tables
- 00:15:36together and create one big pivot table
- 00:15:39it means I'm going to be able to do
- 00:15:41things like create a pivot table that
- 00:15:43shows the product name and the amount of
- 00:15:46that product that's sold okay so we have
- 00:15:49our data stored in multiple different
- 00:15:52sources we have the products file we
- 00:15:54have the accounts file and then we have
- 00:15:56our two transaction files as well
- 00:15:59so this is where the data model is going
- 00:16:02to be particularly useful
- 00:16:04now I'm just going to close down all of
- 00:16:07the files that I've currently got open
- 00:16:09do I have anything else open yes I do
- 00:16:11let's close down both of those
- 00:16:15and make sure that that is closed
- 00:16:19and I'm just going to double click to
- 00:16:21open up the transaction folder again
- 00:16:24so the first thing that we're going to
- 00:16:25do here is I'm going to combine both of
- 00:16:28these files together into one big file
- 00:16:31now notice here that I've got them
- 00:16:34stored in a folder called transaction
- 00:16:36data and currently I have the file for
- 00:16:392019 and 2020. now each year a new file
- 00:16:44is going to be added so I have the
- 00:16:46transactions 2021 file ready to go into
- 00:16:49this folder so when I'm creating my
- 00:16:52pivot table and setting this up using
- 00:16:54the data source I sorry using the data
- 00:16:57model I want to set this up in such a
- 00:16:59way so that it's extremely efficient so
- 00:17:02that when a new file gets added into
- 00:17:04this transaction data folder I can
- 00:17:07update my Pivot tables in any pivot
- 00:17:09charts that I've created with the click
- 00:17:11of one button
- 00:17:13so we're going to set this up so that
- 00:17:15links to this folder so that anything
- 00:17:18new that's added to the folder is
- 00:17:20automatically going to be included in
- 00:17:22our report okay
- 00:17:24so we're doing a few different things
- 00:17:26here quite a lot going on
- 00:17:29so let's close this down and let's open
- 00:17:32up Excel
- 00:17:36now for this we're just going to start
- 00:17:38with a blank workbook and I will say if
- 00:17:41you are following along with me make
- 00:17:43sure that you have all of the other
- 00:17:44Excel files closed down before you begin
- 00:17:48so let's maximize this out
- 00:17:51now the first thing I'm going to do is
- 00:17:52I'm going to create a connection to that
- 00:17:55transaction data folder I'm going to
- 00:17:57create a link between this Excel
- 00:17:59workbook and that folder now anytime we
- 00:18:02want to bring in data from outside into
- 00:18:05Excel we want to make sure that we go to
- 00:18:07the data tab
- 00:18:09and it's this first group here get and
- 00:18:12transform data so this is where we can
- 00:18:14pull data in from multiple different
- 00:18:16sources so it really depends how you
- 00:18:18have your data stored I could import
- 00:18:20data from a text file or from the web or
- 00:18:24from another table or range that I have
- 00:18:27in my workbook and if I click the get
- 00:18:29data drop down you can see that I have
- 00:18:31multiple other places that I can grab
- 00:18:34data from so if I've got it stored in
- 00:18:36another Excel workbook I can link to
- 00:18:38that from here as well now we want to
- 00:18:41link to that transaction data folder and
- 00:18:45notice right at the bottom of the list
- 00:18:47this is where we can set up that link so
- 00:18:49I'm going to say let's import data from
- 00:18:52a folder
- 00:18:55and I'm going to go to my desktop where
- 00:18:57I have that transaction data folder now
- 00:19:01I'm not going to go into this and select
- 00:19:03the files I want to link to the actual
- 00:19:05folder itself so let's select it and
- 00:19:08click on open
- 00:19:12and this is where it's going to pop open
- 00:19:14this little window
- 00:19:16so you can see here it's found the two
- 00:19:19files that are contained within that
- 00:19:21folder transactions 2019 and
- 00:19:24transactions 2020.
- 00:19:27and right at the bottom here I have a
- 00:19:29few different things that I can do at
- 00:19:31this stage notice I have a combine
- 00:19:34button so as I mentioned because these
- 00:19:36files are consistent in their column
- 00:19:38headings it's going to be quite useful
- 00:19:40for me to combine them into one big long
- 00:19:42file now I can do that directly from
- 00:19:45down here I can choose to load this
- 00:19:48directly into Excel or into a pivot
- 00:19:50table or I can choose to transform the
- 00:19:53data now transforming data basically
- 00:19:56gives you the opportunity to tidy up
- 00:19:59your data so if you haven't cleaned your
- 00:20:01data before beforehand you could
- 00:20:03transform the data from here so let's
- 00:20:06click that because it's going to jump us
- 00:20:07into Power query
- 00:20:11now once again this looks a little bit
- 00:20:13overwhelming and we're not going to go
- 00:20:14into this in any detail whatsoever this
- 00:20:17is an entire session on its own all you
- 00:20:20really need to know is that power query
- 00:20:21is a more user-friendly way of cleaning
- 00:20:25up Excel data so if you've ever had a
- 00:20:27data source in Excel and you've done
- 00:20:29things like remove the duplicates
- 00:20:31removed blank rows maybe done a spell
- 00:20:33check or a find and replace
- 00:20:35all of that process is called cleaning
- 00:20:38data and we can do the same thing in
- 00:20:41power query check out what we have up
- 00:20:43here as an example we can do things like
- 00:20:45remove columns we can split columns we
- 00:20:48can change the formatting of different
- 00:20:50columns things like that so this is
- 00:20:52really a data cleaning utility
- 00:20:55now we're not going to really use it to
- 00:20:57clean the data because our data is
- 00:20:59already clean but what we're going to do
- 00:21:01is we're going to use it to combine
- 00:21:03these two files together
- 00:21:05so I've got both of my files sitting
- 00:21:07there notice in this First Column where
- 00:21:10it says content I have these two little
- 00:21:12down facing arrows and it says combine
- 00:21:16files if I click this it's going to
- 00:21:19evaluate my two files
- 00:21:22it's going to show me a sample of the
- 00:21:24first file so it's going to show me
- 00:21:26basically the first 200 rows of the
- 00:21:29first file
- 00:21:30that all looks good to me I'm going to
- 00:21:32click on OK and it's going to combine
- 00:21:35transactions 2019 and transactions 2020
- 00:21:38together in one big long file
- 00:21:43so a nice quick way of combining those
- 00:21:45together
- 00:21:46now at this stage I could look through
- 00:21:48and I could start cleaning up this
- 00:21:50combined data if I wanted to so maybe
- 00:21:53I've got some errors in here some blank
- 00:21:55rows I could use power query to tidy it
- 00:21:57all up I'm going to do a couple of
- 00:21:59little changes here because there is
- 00:22:01something that's been added to my
- 00:22:03spreadsheet that I don't particularly
- 00:22:05need and that is this Source name column
- 00:22:07because I have two files in here it's
- 00:22:10helpfully giving me another color which
- 00:22:12tells me what the source name is now I
- 00:22:14don't really want that so I'm just going
- 00:22:15to right click and I'm going to say
- 00:22:17remove this column
- 00:22:19the other thing I'm quickly going to do
- 00:22:21is check to make sure I have the correct
- 00:22:23data type selected for these fields so
- 00:22:26this one is the date this one is a
- 00:22:28number these all look pretty good
- 00:22:30the amount now this is a currency amount
- 00:22:33so I'm going to click where it says one
- 00:22:34two three and make sure we set the data
- 00:22:37type for that column to currency
- 00:22:40as I said there is so much we could go
- 00:22:42into in power query I'm just going to
- 00:22:44show you those couple of little bits
- 00:22:46here we've combined the files and we can
- 00:22:48now load it back into Excel as one big
- 00:22:51long file
- 00:22:53so at the top here we have close and
- 00:22:56load and I'm going to say close and load
- 00:22:58to
- 00:23:00now if I just wanted to combine these
- 00:23:02two transaction files together and
- 00:23:04create a pivot table I could select
- 00:23:06create pivot table report from here and
- 00:23:09it's going to automatically create the
- 00:23:11report for me now I don't want to do
- 00:23:13that because I have more data that I
- 00:23:15want to add in remember we have that
- 00:23:19smaller accounts workbook and we have
- 00:23:21that smaller product workbook that I
- 00:23:24want to use in my pivot table as well
- 00:23:26so instead of creating the pivot table
- 00:23:28report I'm going to say add this data to
- 00:23:32the data model and click on OK
- 00:23:36now it's going to go away and it's going
- 00:23:37to create its Connections in the
- 00:23:39background and you can see on the right
- 00:23:41hand side I have a queries and
- 00:23:43connections pane open that's telling me
- 00:23:45that I've got 730 rows of data loaded in
- 00:23:49so this is basically those two
- 00:23:51transaction files combined together and
- 00:23:54I should be able to check this by if I
- 00:23:56click the filter at the top here yes I
- 00:23:58have both of my data sets in there 2019
- 00:24:01and 20 20.
- 00:24:03but as I said this isn't the only data
- 00:24:06that I want to use in my pivot table
- 00:24:08so how can we also pull in those other
- 00:24:13two tables of data
- 00:24:15well we can do this in a few different
- 00:24:16ways but I'm going to show you how to do
- 00:24:18it using the power pivot ribbon
- 00:24:21now if you take a look up at my ribbons
- 00:24:24I have one here called Power pivot now
- 00:24:27this isn't a ribbon that's turned on by
- 00:24:29default so if you cannot see this ribbon
- 00:24:32it might be that you need to add that in
- 00:24:35in so if we go to file and down to let's
- 00:24:40go to options
- 00:24:42and uh we're going to go to customize
- 00:24:46ribbon
- 00:24:47and you can see it there selected on the
- 00:24:50right hand side powerpivot if you have
- 00:24:52it deselected then you're not going to
- 00:24:53be able to see that ribbon now if you
- 00:24:56can't see powerpivot in here at all it
- 00:24:58might be that you need to go to add-ins
- 00:25:01and I think this is under
- 00:25:04com add-ins
- 00:25:07let's click on go yes that one there
- 00:25:09power pivot for Excel okay so if you
- 00:25:13can't see it make sure you have that
- 00:25:15add-in turned on and then you can see
- 00:25:17that power pivot ribbon because this is
- 00:25:19really going to help you when it comes
- 00:25:21to adding things into the data model
- 00:25:25so we've got our two transaction files
- 00:25:27here I've got two more files that I want
- 00:25:30to pull in before I create my pivot
- 00:25:32table
- 00:25:33so what we can do here is we can use our
- 00:25:36powerpivot ribbon we can go to manage
- 00:25:40notice that that is in the data model
- 00:25:42group
- 00:25:43and it's going to open up our
- 00:25:45transaction data in the powerpivot
- 00:25:47window
- 00:25:48and take a look at the bottom we've got
- 00:25:50the tab here transaction data and now I
- 00:25:53can add more tables into here which is
- 00:25:56effectively adding them into the data
- 00:25:59model
- 00:26:00so if we take a look at the ribbons at
- 00:26:02the top where we have get external data
- 00:26:04I'm going to choose from other sources
- 00:26:09so this is where I can now go away and
- 00:26:11choose where my other tables of data
- 00:26:13that I want to use are located so maybe
- 00:26:16I have a table in Access that I want to
- 00:26:18use maybe it's a text file in this case
- 00:26:21I have two other Excel files that I want
- 00:26:24to pull in so I'm going to choose Excel
- 00:26:26file click on next and now I can simply
- 00:26:30browse for the first file
- 00:26:33so I want to pull in the accounts file
- 00:26:35and the products file as well I want to
- 00:26:37use these along with my transaction data
- 00:26:40in my pivot table so let's select
- 00:26:43accounts first of all we have to do
- 00:26:45these one at a time
- 00:26:47I'm going to say use the first row as
- 00:26:49the column headings
- 00:26:52click on next and click on finish
- 00:26:56and you can see it's imported four rows
- 00:26:59successfully and if you recall this
- 00:27:02actual data was very short and you can
- 00:27:04see it loaded into the new window just
- 00:27:06here that is the account data and the
- 00:27:09accounts that match it
- 00:27:11now notice at the bottom we now have two
- 00:27:12sheets so I've got my transaction data
- 00:27:14as one part of the data model and then I
- 00:27:17just have sheet1 now I'm going to right
- 00:27:18click and rename this to make it more
- 00:27:21meaningful let's call this accounts
- 00:27:25and now I can go back up and repeat that
- 00:27:27process to pull in the other worksheet
- 00:27:31so again from other sources I'm going to
- 00:27:34scroll all the way down
- 00:27:36import from Excel
- 00:27:39I'm going to browse
- 00:27:41and I'm going to choose products this
- 00:27:44time
- 00:27:46I'm going to use the first row as column
- 00:27:48headings
- 00:27:50and click on finish
- 00:27:54and that's going to import that table
- 00:27:57into the data model as well so now at
- 00:28:00the bottom I have three tabs I have my
- 00:28:02transaction data tab which is a
- 00:28:04combination of two different files
- 00:28:05transactions 2019 and 2020 I have my
- 00:28:09accounts table and I have my products
- 00:28:12table and these are all now part of the
- 00:28:15data model and I can use them to build a
- 00:28:18pivot table
- 00:28:20now something that's also quite useful
- 00:28:23when you're in this powerpivot window is
- 00:28:26this diagram view button
- 00:28:28so if I click on diagram view this is
- 00:28:31basically going to show us all of the
- 00:28:32tables that we've created in this
- 00:28:34diagram format and we can move these
- 00:28:37around
- 00:28:38and it gives us a nice visual way of
- 00:28:40looking at how our tables are related
- 00:28:42together
- 00:28:43so you can see at the top here I have my
- 00:28:45transaction data table and those are all
- 00:28:47the column headings I then have my
- 00:28:49accounts table and my products table
- 00:28:52now currently all three of these tables
- 00:28:55are part of the data model but they're
- 00:28:57not linked together in any way they're
- 00:29:00still three independent tables
- 00:29:02so what do you think is going to happen
- 00:29:04if I try and build a pivot table based
- 00:29:07off of this data model and maybe I use
- 00:29:10let's say I use the amount field from
- 00:29:13the transaction data table and the
- 00:29:15products field from the products table
- 00:29:17what do you think is going to happen is
- 00:29:19that going to work
- 00:29:23if you guessed no then you would be
- 00:29:25correct because these tables aren't
- 00:29:28linked together Excel thinks they're
- 00:29:30just independent of one another so
- 00:29:32nothing is going to flow through let me
- 00:29:34show you an example of that so you
- 00:29:36understand what I mean
- 00:29:38let's close this powerpivot window down
- 00:29:42and let's create our first pivot table
- 00:29:46so I'm going to close down queries and
- 00:29:48connections
- 00:29:49I'm going to click in my data I'm going
- 00:29:51to go to insert and I'm going to say
- 00:29:53pivot table from data model
- 00:29:57I'm going to say I want this on a new
- 00:29:59worksheet let's click on ok now I can
- 00:30:03see here look at what we've got forget
- 00:30:05about that one at the bottom that's just
- 00:30:07from an old table that I was using these
- 00:30:09are the ones from our data model so
- 00:30:12we've got our accounts table and our
- 00:30:14Fields just there our products table and
- 00:30:16our fields and then our transaction data
- 00:30:18and our fields now remember these are
- 00:30:21all three independent tables so if I now
- 00:30:25try and build a pivot table using a
- 00:30:27field from the accounts table so let's
- 00:30:29grab accounts and drag it into rows
- 00:30:31all looks okay so far but if I now try
- 00:30:35to drag the amount field from the
- 00:30:38transaction data table into values
- 00:30:41it's not working it's giving me all of
- 00:30:43the same value it's not able to work
- 00:30:46this out how much sales we've generated
- 00:30:49by those different accounts because none
- 00:30:52of those tables are interacting with
- 00:30:54each other they're just not linked
- 00:30:55together yet
- 00:30:57so we've got errors well not errors I
- 00:31:00should say we've got the same value so
- 00:31:02we know that that's not correct and take
- 00:31:04a look at this yellow message it says
- 00:31:07relationships between tables may be
- 00:31:10needed
- 00:31:11so we need to link all three of our
- 00:31:14tables together in order for this to
- 00:31:16work correctly
- 00:31:18so how do we go about linking tables
- 00:31:20together
- 00:31:21well this is very similar to if you've
- 00:31:23ever used something like vlookup you
- 00:31:26need to have a field in each table that
- 00:31:28is common between the tables for example
- 00:31:31the transaction data table is our main
- 00:31:34table it has the most information we
- 00:31:36have date transaction ID product number
- 00:31:38account number amount
- 00:31:41the accounts table we have account
- 00:31:43number we also have account number in
- 00:31:46the transaction data table so there is a
- 00:31:49common field between the accounts table
- 00:31:51and the transaction data table
- 00:31:54so I could use the account number field
- 00:31:55to link these two tables together
- 00:31:59similarly I can link the products table
- 00:32:01to transaction data by the product
- 00:32:04number field
- 00:32:06and if I do that and create these
- 00:32:08relationships then Excel knows about
- 00:32:12these other tables and it can perform
- 00:32:13the calculations correctly
- 00:32:16so let's take a look at that in action
- 00:32:18now I can see here I've got this little
- 00:32:20little yellow warning message it's
- 00:32:23saying relationships are needed so I'm
- 00:32:25going to say okay let's create our first
- 00:32:27relationship
- 00:32:29so I want to create a relationship first
- 00:32:31of all between the transaction data
- 00:32:34table and the accounts table
- 00:32:37so the first table is the transaction
- 00:32:39data table
- 00:32:41the related table is the accounts table
- 00:32:44and then I just need to tell Excel which
- 00:32:47field they're linked by
- 00:32:49so what is the common field between
- 00:32:51these two tables well it's the account
- 00:32:53number field
- 00:32:55so as soon as I select account number
- 00:32:57here Excel recognizes it in the other
- 00:32:59one and adds it in for me
- 00:33:01now as soon as I click on OK here check
- 00:33:04out what happens to the pivot table you
- 00:33:06should see that those numbers work
- 00:33:08themselves out so let's click on OK
- 00:33:11and there we go it is now working
- 00:33:13because we've created that link Excel
- 00:33:17knows how to do the calculations
- 00:33:20so we've created a link between the
- 00:33:22accounts table and the transaction data
- 00:33:24table
- 00:33:26what about if I remove accounts from
- 00:33:27rows and switch in products I'm going to
- 00:33:31get the same problem because I haven't
- 00:33:33linked products to transaction data once
- 00:33:38again I have the value the same value
- 00:33:40being repeated over and over again and
- 00:33:42I'm getting this yellow warning message
- 00:33:45so once again I'm going to do the same
- 00:33:47thing let's click on create we're going
- 00:33:49to link the transaction data table
- 00:33:52and the products table
- 00:33:54but this time we're going to use the
- 00:33:57field that's common between the two
- 00:33:58which is the product number field
- 00:34:01so let's select product number
- 00:34:04click on OK and take a look at that
- 00:34:06everything is now working
- 00:34:10so now that everything is linked
- 00:34:11together I can start building out my
- 00:34:14pivot table using any field from any of
- 00:34:17these tables and because I've now added
- 00:34:20in additional data my data's a lot more
- 00:34:22meaningful instead of just having
- 00:34:24product numbers which don't mean much to
- 00:34:26anybody in my analysis I've now pulled
- 00:34:30in these product names instead so it's
- 00:34:32going to be a lot more meaningful to
- 00:34:33anybody who's looking at this data
- 00:34:37once I have all this data in here I can
- 00:34:38then start using my pivot table fields
- 00:34:40in exactly the same way I normally would
- 00:34:43so maybe I want to add in something like
- 00:34:45let's go for a date above rows
- 00:34:49something like that and you can see I'm
- 00:34:52going to remove quarters a month so that
- 00:34:53we just have the years I could drag date
- 00:34:56across to columns so I have it organized
- 00:34:59like that instead so once you have
- 00:35:02everything linked together
- 00:35:04everything should work nicely together
- 00:35:06as long as you've created those
- 00:35:08relationships between the tables again
- 00:35:10it's much like vlookup it relies on a
- 00:35:13common field
- 00:35:15so that is basically how you can utilize
- 00:35:18the data model to pull in data from
- 00:35:21different sources to create a
- 00:35:24Consolidated pivot table
- 00:35:26now we're going to do one more thing Let
- 00:35:29me just do a quick time check we're
- 00:35:31going to be a little bit quicker than
- 00:35:32normal in this session which is very
- 00:35:34nice if everybody gets to go a little
- 00:35:35bit earlier but there is one more thing
- 00:35:37that I want to do
- 00:35:39I'm going to show you how to very
- 00:35:41quickly create a pivot chart based off
- 00:35:43of this pivot data and then I'm going to
- 00:35:45show you how to update with the next
- 00:35:48year's transaction file because if you
- 00:35:51remember right at the beginning when we
- 00:35:53created our connection we created a
- 00:35:56connection to the folder where these
- 00:35:58transaction files were stored
- 00:36:00so theoretically when I add the next
- 00:36:02year's file into that folder all of my
- 00:36:04Pivot tables and pivot charts should
- 00:36:07update automatically because that
- 00:36:08connection is there to the folder
- 00:36:11so let's first do a little bit of
- 00:36:13tidying up of this data and create
- 00:36:15ourselves a basic pivot chart
- 00:36:18now in my Pivot chart I don't want my
- 00:36:20grand totals so let's utilize uh uh
- 00:36:24let's go to the design tab at the top
- 00:36:26here
- 00:36:27and I'm going to turn off Grand totals
- 00:36:29for rows and columns so we're going to
- 00:36:32click on Grand totals and I'm going to
- 00:36:35say turn those off in general you don't
- 00:36:38tend to have grand total showing in
- 00:36:40pivot charts it's not particularly very
- 00:36:42helpful
- 00:36:43now again when it comes to creating
- 00:36:45things like pivot charts based off of
- 00:36:47pivot data be quite mindful as to the
- 00:36:49chart type that you're selecting for
- 00:36:52example data like this we've got quite a
- 00:36:54bit there it might look alright in a pie
- 00:36:56chart but it would probably be better
- 00:36:58represented in something like a column
- 00:37:00chart or a bar chart
- 00:37:02even then this data might be a little
- 00:37:05bit too much let's have a quick look and
- 00:37:07see what we get
- 00:37:08so I'm going to go to the pivot table
- 00:37:09analyze ribbon
- 00:37:11and we're going to click on pivot chart
- 00:37:14it's not too bad it's going to look like
- 00:37:16that I'm actually going to apply a
- 00:37:18filter because the people that I'm going
- 00:37:20to be showing this pivot chart to are
- 00:37:22only really interested in the top five
- 00:37:25best-selling products so I'm going to
- 00:37:28use a top 10 filter on this data let's
- 00:37:32right click I'm going to go to filter
- 00:37:35I'm going to say top 10 and I'm going to
- 00:37:37take that down to show only the top five
- 00:37:41items by the amount
- 00:37:44now I have a much smaller more
- 00:37:46manageable data set to represent in my
- 00:37:49chart
- 00:37:50so let's go back to Pivot charts and
- 00:37:53yeah I'm just going to stick with the
- 00:37:55basic clustered column chart let's click
- 00:37:57on OK
- 00:38:00so here we go let's drag this out a
- 00:38:02little bit of course you can go to town
- 00:38:04on the formatting of your pivot charts
- 00:38:06I'm going to do some very basic
- 00:38:08formatting here I'm going to remove
- 00:38:10these gray buttons this is the first
- 00:38:12thing I always do because I don't
- 00:38:13particularly like to have these on my
- 00:38:15charts I might want to do something like
- 00:38:19add a chart title so let's just give
- 00:38:22this a bit of meaning so this is the top
- 00:38:26five uh
- 00:38:28products we'll just leave it as top five
- 00:38:30products
- 00:38:33um what else do I want to do here do I
- 00:38:35want to do anything I think we're pretty
- 00:38:37good here maybe I want to change the
- 00:38:38color make it a little bit more
- 00:38:39interesting let's go to design I'm going
- 00:38:42to go to change color I'm just going to
- 00:38:44make this various different shades of
- 00:38:47blue
- 00:38:48as I said so much more you can do when
- 00:38:50it comes to formatting your charts but
- 00:38:53what I really want to show you here is
- 00:38:54how simple it is to add the transaction
- 00:38:58file for 2021 and have everything that
- 00:39:01you've created update
- 00:39:04so take a look at the pivot table and
- 00:39:06the pivot chart currently you can see
- 00:39:08that we only have data for 2019 and
- 00:39:112020. that's also reflected in the
- 00:39:13legend in the pivot chart as well 2019
- 00:39:16and 2020.
- 00:39:19now when we created this we created a
- 00:39:21link to that transaction data folder
- 00:39:24so let's minimize Excel
- 00:39:27I'm going to open up this transaction
- 00:39:29data folder
- 00:39:31and what we're going to say is we're
- 00:39:33going to say it's the end of 2021 and we
- 00:39:37want to add the years transaction data
- 00:39:40into this folder and have everything
- 00:39:42update automatically in our pivot table
- 00:39:45and our pivot chart
- 00:39:47because we've linked to the folder we
- 00:39:49can do this very simply
- 00:39:51so you should also have the file that I
- 00:39:54sent through called transactions 20 2021
- 00:39:57saved off to your desktop I have mine in
- 00:39:59this folder called new data
- 00:40:02so what I want you to do is move or copy
- 00:40:04this file into the transaction data
- 00:40:07folder so I'm just going to drag and
- 00:40:10drop this file into here
- 00:40:15I'll give you a couple of seconds just
- 00:40:17to do that if you're following along
- 00:40:21so now that I've done that each year I
- 00:40:24might do exactly the same thing if I
- 00:40:27want to have that data included in my
- 00:40:29analysis all I have to do is go back to
- 00:40:32my pivot table and refresh it
- 00:40:35and that is literally a one-click option
- 00:40:39all you need to do is click in the pivot
- 00:40:40table or click on the pivot chart go up
- 00:40:43to pivot table analyze and in the middle
- 00:40:45here you have a refresh button now check
- 00:40:49out what happens when I click on refresh
- 00:40:51all you should see that a column is
- 00:40:54added automatically to the pivot table
- 00:40:56for 2021 and we should get another bar
- 00:40:58in our chart so let's click on refresh
- 00:41:01all
- 00:41:03and would you take a look at that how
- 00:41:06quick has that been to do and that's
- 00:41:08simply because we created a link to the
- 00:41:11folder and we can then simply upload the
- 00:41:13file each year to this folder click the
- 00:41:16refresh button and all of our reporting
- 00:41:18is updated in one click
- 00:41:21really nice and straightforward
- 00:41:25so that is pretty much what I wanted to
- 00:41:27show you today as I said we have
- 00:41:28finished a little bit quicker to normal
- 00:41:30there is a lot that we covered in there
- 00:41:33it can be quite overwhelming and with
- 00:41:35something like this there are numerous
- 00:41:37different ways that you can do this I
- 00:41:39know that some people don't use the
- 00:41:40power pivot ribbon at all some people
- 00:41:43just import all of their data through
- 00:41:45this get data area some people use
- 00:41:47entirely power pivot there's many
- 00:41:49different ways I've just showed you ways
- 00:41:52that tend to work for me in ways that
- 00:41:54make sense to me but as always you can
- 00:41:57do your own research and find out the
- 00:41:59best method that suits you
- 00:42:02but hopefully you now have a better
- 00:42:03understanding not only as to the
- 00:42:05difference between creating a pivot
- 00:42:07table based off of one data source for
- 00:42:09how you can create a Consolidated pivot
- 00:42:11table where you're bringing in data from
- 00:42:13multiple data sources and the biggest
- 00:42:16thing here for me is really linking to a
- 00:42:19folder to make updating your data so
- 00:42:22much quicker and easier and effectively
- 00:42:24making yourself more efficient
- 00:42:27if you're not a subscriber click down
- 00:42:30below to subscribe so you get notified
- 00:42:32about similar videos we upload
- 00:42:34to see the full course that this video
- 00:42:37came from click over there and
- 00:42:41click over there to see more videos from
- 00:42:44Simon says it
- Excel
- Pivot Tables
- Data Model
- Power Query
- Data Transformation
- Consolidated Data
- Data Analysis
- Data Relationships
- Webinar
- Microsoft Excel