A Data Model allows you to integrate data from multiple tables, effectively building a relational data source inside an Excel workbook. Within Excel, Data Models are used transparently, providing tabular data used in PivotTables and PivotCharts. A Data Model is visualized as a collection of tables in a Field List, and most of the time, you’ll never even know it’s there.
Before you can start working with the Data Model, you need to get some data. For that we’ll use the Get & Transform (Power Query) experience, so you might want to take a step back and watch a video, or follow our learning guide on Get & Transform and Power Pivot.
Where is Power Pivot?
-
Excel 2016 & Excel for Microsoft 365 — Power Pivot is included in the Ribbon.
-
Excel 2013 — Power Pivot is part of the Office Professional Plus edition of Excel 2013, but is not enabled by default. Learn more about starting the Power Pivot add-in for Excel 2013.
-
Excel 2010 — Download the Power Pivot add-in, then install the Power Pivot add-in.
Where is Get & Transform (Power Query)?
-
Excel 2016 & Excel for Microsoft 365 — Get & Transform (Power Query) has been integrated with Excel on the Data tab.
-
Excel 2013 — Power Query is an add-in that’s included with Excel, but needs to be activated. Go to File > Options > Add-Ins, then in the Manage drop-down at the bottom of the pane, select COM Add-Ins > Go. Check Microsoft Power Query for Excel, then OK to activate it. A Power Query tab will be added to the ribbon.
-
Excel 2010 — Download and install the Power Query add-in.. Once activated, a Power Query tab will be added to the ribbon.
Getting started
First, you need to get some data.
-
In Excel 2016, and Excel for Microsoft 365, use Data > Get & Transform Data > Get Data to import data from any number of external data sources, such as a text file, Excel workbook, website, Microsoft Access, SQL Server, or another relational database that contains multiple related tables.
In Excel 2013 and 2010, go to Power Query > Get External Data, and select your data source.
-
Excel prompts you to select a table. If you want to get multiple tables from the same data source, check the Enable selection of multiple tables option. When you select multiple tables, Excel automatically creates a Data Model for you.
-
Select one or more tables, then click Load.
If you need to edit the source data, you can choose the Edit option. For more details see: Introduction to the Query Editor (Power Query).
You now have a Data Model that contains all of the tables you imported, and they will be displayed in the PivotTable Field List.
Notes:
-
Models are created implicitly when you import two or more tables simultaneously in Excel.
-
Models are created explicitly when you use the Power Pivot add-in to import data. In the add-in, the model is represented in a tabbed layout similar to Excel, where each tab contains tabular data. See Get data using the Power Pivot add-into learn the basics of data import using a SQL Server database.
-
A model can contain a single table. To create a model based on just one table, select the table and click Add to Data Model in Power Pivot. You might do this if you want to use Power Pivot features, such as filtered datasets, calculated columns, calculated fields, KPIs, and hierarchies.
-
Table relationships can be created automatically if you import related tables that have primary and foreign key relationships. Excel can usually use the imported relationship information as the basis for table relationships in the Data Model.
-
For tips on how to reduce the size of a data model, see Create a memory-efficient Data Model using Excel and Power Pivot.
-
For further exploration, see Tutorial: Import Data into Excel, and Create a Data Model.
Create Relationships between your tables
The next step is to create relationships between your tables, so you can pull data from any of them. Each table needs to have a primary key, or unique field identifier, like Student ID, or Class number. The easiest way is to drag and drop those fields to connect them in Power Pivot’s Diagram View.
-
Go to Power Pivot > Manage.
-
On the Home tab, select Diagram View.
-
All of your imported tables will be displayed, and you might want to take some time to resize them depending on how many fields each one has.
-
Next, drag the primary key field from one table to the next. The following example is the Diagram View of our student tables:
We’ve created the following links:
-
tbl_Students | Student ID > tbl_Grades | Student ID
In other words, drag the Student ID field from the Students table to the Student ID field in the Grades table.
-
tbl_Semesters | Semester ID > tbl_Grades | Semester
-
tbl_Classes | Class Number > tbl_Grades | Class Number
Notes:
-
Field names don’t need to be the same in order to create a relationship, but they do need to be the same data type.
-
The connectors in the Diagram View have a «1» on one side, and an «*» on the other. This means that there is a one-to-many relationship between the tables, and that determines how the data is used in your PivotTables. See: Relationships between tables in a Data Model to learn more.
-
The connectors only indicate that there is a relationship between tables. They won’t actually show you which fields are linked to each other. To see the links, go to Power Pivot > Manage > Design > Relationships > Manage Relationships. In Excel, you can go to Data > Relationships.
-
Use a Data Model to create a PivotTable or PivotChart
An Excel workbook can contain only one Data Model, but that model can contain multiple tables which can be used repeatedly throughout the workbook. You can add more tables to an existing Data Model at any time.
-
In Power Pivot, go to Manage.
-
On the Home tab, select PivotTable.
-
Select where you want the PivotTable to be placed: a new worksheet, or the current location.
-
Click OK, and Excel will add an empty PivotTable with the Field List pane displayed on the right.
Next, create a PivotTable, or create a Pivot Chart. If you’ve already created relationships between the tables, you can use any of their fields in the PivotTable. We’ve already created relationships in the Student Data Model sample workbook.
Add existing, unrelated data to a Data Model
Suppose you’ve imported or copied lots of data that you want to use in a model, but haven’t added it to the Data Model. Pushing new data into a model is easier than you think.
-
Start by selecting any cell within the data that you want to add to the model. It can be any range of data, but data formatted as an Excel table is best.
-
Use one of these approaches to add your data:
-
Click Power Pivot > Add to Data Model.
-
Click Insert > PivotTable, and then check Add this data to the Data Model in the Create PivotTable dialog box.
The range or table is now added to the model as a linked table. To learn more about working with linked tables in a model, see Add Data by Using Excel Linked Tables in Power Pivot.
Adding data to a Power Pivot table
In Power Pivot, you cannot add a row to a table by directly typing in a new row like you can in an Excel worksheet. But you can add rows by copying and pasting, or updating the source data and refreshing the Power Pivot model.
Need more help?
You can always ask an expert in the Excel Tech Community or get support in the Answers community.
See Also
Get & Transform and Power Pivot learning guides
Introduction to the Query Editor (Power Query)
Create a memory-efficient Data Model using Excel and Power Pivot
Tutorial: Import Data into Excel, and Create a Data Model
Find out which data sources are used in a workbook data model
Relationships between tables in a Data Model
What is the Data Model in Excel?
The data model in Excel is a type of data table where two or more two tables are in a relationship with each other through a common or more data series. In the data model, tables and data from various other sheets or sources come together to form a unique table that can access the data from all the tables.
For example, a data table containing tables of customers, product items, and product sellers. We can use the Excel data model to connect this dataset and create a relationship between them.
Table of contents
- What is the Data Model in Excel?
- Explanation
- Examples
- Example #1
- Example #2
- Things to Remember
- Recommended Articles
Explanation
- It allows integrating data from multiple tables by creating relationships based on a common column.
- Data models are used transparently, providing tabular data that can be used in a Pivot Table in ExcelA Pivot Table is an Excel tool that allows you to extract data in a preferred format (dashboard/reports) from large data sets contained within a worksheet. It can summarize, sort, group, and reorganize data, as well as execute other complex calculations on it.read more and Pivot Charts in excelIn Excel, a pivot chart is a built-in feature that allows you to summarize selected rows and columns of data in a spreadsheet. It is a visual representation of a pivot table that helps in the summarization and analysis of datasets, patterns, and trends.read more. In addition, it integrates the tables, enabling extensive analysis using pivot tables, power pivot, and Power View in ExcelExcel Power View is a data visualization technology that helps you create interactive visuals like graphs, charts. It allows you to analyze data by looking at the visuals you created. As a result, it makes your excel data more meaningful and insightful for better decision making.read more.
- The data model allows loading data into Excel’s memory.
- It is saved in memory, where we cannot directly see it. Then We can instruct Excel to relate data to each other using a common column. The ‘Model’ part of the data model refers to how all tables relate.
- The data model can access all the information it needs, even in multiple tables. After the data model is created, Excel has the data available in its memory. With the data in its memory, we can access the data in many ways.
Examples
You can download this Data Model Excel Template here – Data Model Excel Template
Example #1
We have three datasets related to the salesperson: the first contains revenue information, the second includes the salesperson’s income and the third consists of the expenses of the salesperson.
To connect these three datasets and make a relationship with them, we make a data model with the following steps:
- Convert the datasets to table objects:
We cannot create a relationship with ordinary datasets. The data model works with only Excel TablesIn excel, tables are a range with data in rows and columns, and they expand when new data is inserted in the range in any new row or column in the table. To use a table, click on the table and select the data range.read more objects. To do this:
- Step 1 – We must first click anywhere inside the dataset, click on the “Insert” tab, and click on “Table” in the “Tables” group.
- Step 2 – Check or uncheck the ‘My table has headers’ option and click “OK.”
- Step 3 – We must enter the table’s name in the “Table Name” in the “Tools” group with the new table selected.
- Step 4 – Now, we can see that the first dataset is converted to a “Table” object. On repeating these steps for the other two datasets, we know that they also get converted to “Table” objects as below:
Adding the “Table” objects to the Data Model: Via Connections or Relationships.
Via Connections
- We must select one table, click on the “Data” tab, and click on “Connections.”
- There is an icon for “Add.” Expand the dropdown of “Add” and click on “Add to the Data Model” in the resulting dialog box.
- Click on “Tables” in the resulting dialog box, select one of the tables, and click “Open.”
In doing this, it would create a workbook data model with one table, and a dialog box would appear as follows:
So if we repeat these steps for the other two tables, the data model will contain all three tables.
We can now see that all three tables appear in the “Workbook Connections.”
Via Relationships
Create the relationship: Once both the datasets are table objects, we can create a relationship between them. To do this:
- First, we should click on the “Data” tab and “Relationships.”
- As a result, we can see an empty dialog box with no current connections.
- Then, click on “New,” and another dialog box appears.
- Expand the “Table” and “Related Table” dropdowns: the “Create Relationship” dialog box appears to pick the tables and columns to use for a relationship. In the expansion of “Tables,” we must select the dataset we wish to analyze somehow, and in “Related Table,” we must choose the dataset with LOOKUP values.
- The lookup table in excelLookup tables are simply named tables that are used in combination with the VLOOKUP function to find any data in a large data set. We can select the table and name it, and then type the table’s name instead of the reference to look up the value.read more is the smaller table in the case of one to many relationships. It contains no repeated values in the common column. In expanding “Column (Foreign),” we must select the common column in the main table. In “Related Column (Primary),” we must choose the common column in the related table.
- With all these four settings selected, click on “OK.” A dialog box appears as follows on clicking on “OK.”
If we repeat these steps to relate the other two tables: the “Revenue” Table with “Expenses” table, then they also get connected in the data model as follows:
Excel now creates the relationship behind the scenes by combining data in the data model based on a common column: Salesperson ID (in this case).
Example #2
Now, in the above example, we wish to create a PivotTable that evaluates or analyzes the table objects:
- We must first click on “Insert” -> “PivotTable.”
- We need to click on the “Use an external data source” option in the resulting dialog box and click on “Choose Connection.”
- Then, we must click on “Tables” in the resulting dialog box, select the “Workbook Data Model” containing three tables, and click “Open.”
- Select the “New Worksheet” option in the location and click on “OK.”
- Consequently, the “PivotTable Fields” pane will display table objects.
Now we can make changes in the PivotTable accordingly to analyze the table objects as required. - For instance, in this case, if we wish to find the total revenue or revenue for a particular salesperson, then a PivotTable is created as follows:
It is an immense help in the case of a model/table containing a large number of observations.
So, we can see that the pivot table instantly uses the data model (picking it by choosing connection) in Excel memory to show relationships between tables.
Things to Remember
- We can analyze data from several tables at once using the data model.
- By creating relationships with the data model, we surpass the need for using VLOOKUPThe VLOOKUP excel function searches for a particular value and returns a corresponding match based on a unique identifier. A unique identifier is uniquely associated with all the records of the database. For instance, employee ID, student roll number, customer contact number, seller email address, etc., are unique identifiers.
read more, SUMIF, INDEX functionThe INDEX function in Excel helps extract the value of a cell, which is within a specified array (range) and, at the intersection of the stated row and column numbers.read more, and MATCH formulas as we do not need to get all columns within a single table. - Models are implicitly created when datasets are imported in Excel from outside sources.
- We can create table relationships automatically if we import related tables with primary and foreign key relationships.
- While creating relationships, the columns that we are connecting in tables should have the same data type.
- With the pivot tables created with the data model, we can add slicers and slice them on any field at pivot tables we want.
- The advantage of the Data Model over LOOKUP() functionsThe LOOKUP excel function searches a value in a range (single row or single column) and returns a corresponding match from the same position of another range (single row or single column). The corresponding match is a piece of information associated with the value being searched.
read more is that it requires substantially less memory. - Excel 2013 supports only one-to-one or one to many relationships, i.e., one of the tables must have no duplicate values on the column we are linking to.
Recommended Articles
This article is a guide to Data Model in Excel. We discuss creating a data model from Excel tables using connections and relationships, practical examples, and a downloadable Excel template. You may learn more about Excel from the following articles: –
- Excel Value Formula
- Excel MATCH Formula
- Share an Excel Workbook
- Consolidate Data in Excel
Excel Data Model (Table of Contents)
- Introduction to Data Model in Excel
- How to Create a Data Model in Excel?
Introduction to Data Model in Excel
The data model feature of Excel enables the easy building of relationships between easy reporting and their background data sets. It makes data analysis much easier. It allows the integration of data from a plethora of tables spread across multiple worksheets by simply building relationships between matching columns. It works completely behind the scene and greatly simplifies reporting features such as PivotTable etc.
Our article shall attempt to show how to create a pivot table from two tables by employing the Data Model feature, thus establishing a relationship between two table objects and thereby creating a Pivot Table.
How to Create a Data Model in Excel?
Let’s understand how to create the Data Model in Excel with a few examples.
You can download this Data Model Excel Template here – Data Model Excel Template
Example #1
- We have a list of products, and we have a shelving code for each product. We need a table where we have the shelving description along with the shelving codes. So how do we incorporate the shelving descriptions against each shelving code? Perhaps many of us would resort to using VLOOKUP here, but we shall altogether remove the need to use VLOOKUP here using Excel Data Model.
- The table on the left is the data table, and the table on the right is the lookup table. As we can see from the data, it is possible to create a relationship based on common columns.
- Now, the Data Model is only compatible with table objects. So, it might be necessary sometimes to convert data sets to table objects. To do that, follow the below steps.
- Left-click anywhere in the data set.
- Click the Insert tab and navigate to Table in the Tables group or simply press Ctrl+T.
- Uncheck or check the My Table has the Header option. In our example, it does indeed have a header. Click OK.
- While still focused on the new table, we need to provide a name that is meaningful in the Name box (towards the left of the formula bar).
In our example, we have named the table Personnel.
- Now we need to do the same process for the lookup table as well and name it Shelf Code.
Creating a Relationship
So firstly, we shall go to the Data tab and then select Relationships in the Data Tools subgroup. After we click on the Relationships option, in the beginning, since there is no relationship, hence we will have nothing.
We will first click on New to create a relationship. We will now need to provide the primary and the lookup table names from the drop-down list and then also mention the column which is common between the two tables so that we can establish the relationship between the two tables from the drop-down list of columns.
- Now, the primary table is the table that has the data. It is the primary data table – Table5. On the other hand, the Related table is the table that has the lookup data – it is our lookup table ShelfCodesTable. The primary table is the one that is analyzed based on the lookup table, which contains lookup data that will make the reported data, in the end, more meaningful.
- So, the common column between the two tables is the Shelf Code column. This is what we have used to establish the relationship between the two tables. Coming to the columns, the Column (foreign) is the one that refers to the data table where there can be duplicate values. On the other hand, the Related Column (primary) refers to the column in the lookup table where we have unique values. We are simply setting up the field to lookup values from the lookup table in the data table.
- Once we set this up, Excel would create a relationship between the two behind the scene. It integrates the data and creates a data model based on the common column. This is light on the memory requirements and much faster than using VLOOKUP in large workbooks. After defining the Data model, Excel would be treating these objects as Data Model tables instead of a worksheet table.
- Now to see what Excel has been up to, we can click on Manage Data Models in Data -> Data Tools.
- We can also get the diagrammatic representation of the data model by changing the view. We will click on the View option. This will open up the view options. We will then select the Diagram View. Then we will see the diagrammatic representation, showing the two tables and the relationship between them, i.e. the common column – Shelf Code.
- The diagram above shows a one-to-many relationship between the unique lookup table values and the data table with duplicated values.
- Now we will have to create a pivot table. To do that, we will go to the Insert tab and then click on the Pivot Table option.
In the Pivot table’s Create Pivot Table dialogue box, we will select the source as “Use this workbook’s Data Model”.
- This will create the Pivot table, and we can see that both the source tables are available in the source section.
- Now we shall create a pivot table showing the count of each person who has shelved items.
- We will select Personnel in the Rows section from Table 5 (data table), followed by Description (lookup table).
- Now we shall drag the Shelf Code from Table 5 into the Values section.
- Now we shall add Months from Table 5 to the Rows section.
- Or we could add the months as a filter and add it to the Filters section.
Example #2
- We now have Mr Basu running a factory called Basu Corporation. Mr Basu is trying to estimate the revenue for 2019 based on the data from 2018.
- We have a table where we have the revenue for 2018 and the subsequent revenue at different incremental levels.
- So, we have the revenue for 2018 – $1.5 M, and the minimum growth expected the following year is 12%. Mr Basu wants a table that will show the revenue at different incremental levels.
- We will create the following table for the projections at different incremental levels for 2019.
- Now we shall give the first Revenue row a reference to the estimated minimum revenue for 2019, i.e. $1.68 M.
- After using the formula, the answer is shown below.
- Now we shall select the entire table, i.e. D2:E12 and then go to Data ->Forecast ->What-If Analysis ->Data Table.
- This will open up the Data Table dialog box. Here we shall enter the minimum increment percent from cell B4 in the Column Input cell. The reason for that is that our projected estimated Growth percentages in the table are arranged in a columnar fashion.
- Once we click OK, the What-If Analysis will automatically populate the table with projected revenue at the different incremental percentages.
Example #3
- Now suppose we have the same scenario as above, except that now we also have another axis to consider. Suppose, in addition to showing the projected revenue in 2019 based on the data of 2018 and the minimum expected growth rate, we now also have the estimated discount rate.
- First, we shall have a table shown below.
- Now we shall give reference to the minimum projected revenue for 2019, i.e. cell B5 to cell D8.
- Now we shall select the entire table, i.e. D8:J18 and then go to Data ->Forecast ->What-If Analysis ->Data Table.
- This will open up the Data Table dialog box. Here we shall enter the minimum increment percent from cell B3 in the Column Input cell. The reason for that is that our projected estimated Growth percentages in the table are arranged in a columnar fashion. We shall now also additionally enter the minimum discount percent from cell B4 in the Row Input cell. The reason for that is that our projected discount percentages in the table are arranged in a row-wise fashion.
- Click OK. This will make the What-If Analysis automatically populate the table with projected revenue at the different incremental percentages as per the discount percentages.
Things to Remember About Data Model in Excel
- Upon successfully calculating the values from the data table, a simple Undo, i.e. Ctrl+Z, will not work. It is, however, possible to manually delete the values from the table.
- It is not possible to delete a single cell from the table. It is described as an array internally in Excel; hence we will have to delete all the values.
- We need to properly select the Row Input Cell and the Column Input Cell.
- The data table, unlike the Pivot Table, doesn’t need to be refreshed every time.
- Using the Data Model in Excel, we can improve performance and go easy on memory requirements in large worksheets.
- Data Models also makes our analysis much simpler as compared to using a number of complicated formulae all across the workbook.
Recommended Articles
This is a guide to Data Model in Excel. Here we discuss how to create Data Model in Excel along with practical examples and a downloadable excel template. You can also go through our other suggested articles –
- Pivot Table Slicer
- PowerPivot in Excel
- Pivot Table Formula in Excel
- Excel Pivot Table
Содержание
- Create a memory-efficient Data Model using Excel and the Power Pivot add-in
- In this article
- Compression ratios and the in-memory analytics engine
- Nothing beats a non-existent column for low memory usage
- Two examples of columns that should always be excluded
- How to exclude unnecessary columns
- What about filtering just the necessary rows?
- What if we need the column; can we still reduce its space cost?
- Modifying Datetime columns
- Modifying the SQL query
- Using DAX calculated measures instead of columns
- Which 2 columns you should keep?
- Conclusion
- Tutorial: Import Data into Excel, and Create a Data Model
- The sections in this tutorial are the following:
- Import data from a database
- Import data from a spreadsheet
- Import data using copy and paste
Create a memory-efficient Data Model using Excel and the Power Pivot add-in
In Excel 2013 or later, you can create data models containing millions of rows, and then perform powerful data analysis against these models. Data models can be created with or without the Power Pivot add-in to support any number of PivotTables, charts, and Power View visualizations in the same workbook.
Note: This article describes data models in Excel 2013. However, the same data modeling and Power Pivot features introduced in Excel 2013 also apply to Excel 2016. There’s effectively little difference between these versions of Excel.
Although you can easily build huge data models in Excel, there are several reasons not to. First, large models that contain multitudes of tables and columns are overkill for most analyses, and make for a cumbersome Field List. Second, large models use up valuable memory, negatively affecting other applications and reports that share the same system resources. Finally, in Microsoft 365, both SharePoint Online and Excel Web App limit the size of an Excel file to 10 MB. For workbook data models that contain millions of rows, you’ll run into the 10 MB limit pretty quickly. See Data Model specification and limits.
In this article, you’ll learn how to build a tightly constructed model that’s easier to work with and uses less memory. Taking the time to learn best practices in efficient model design will pay off down the road for any model you create and use, whether you’re viewing it in Excel 2013, Microsoft 365 SharePoint Online, on an Office Web Apps Server, or in SharePoint 2013.
Consider also running the Workbook Size Optimizer. It analyzes your Excel workbook and if possible, compresses it further. Download the Workbook Size Optimizer.
In this article
Compression ratios and the in-memory analytics engine
Data models in Excel use the in-memory analytics engine to store data in memory. The engine implements powerful compression techniques to reduce storage requirements, shrinking a result set until it is a fraction of its original size.
On average, you can expect a data model to be 7 to 10 times smaller than the same data at its point of origin. For example, if you’re importing 7 MB of data from a SQL Server database, the data model in Excel could easily be 1 MB or less. The degree of compression actually achieved depends primarily on the number of unique values in each column. The more unique values, the more memory is required to store them.
Why are we talking about compression and unique values? Because building an efficient model that minimizes memory usage is all about compression maximization, and the easiest way to do that is to get rid of any columns that you don’t really need, especially if those columns include a large number of unique values.
Note: The differences in storage requirements for individual columns can be huge. In some cases, it is better to have multiple columns with a low number of unique values rather than one column with a high number of unique values. The section on Datetime optimizations covers this technique in detail.
Nothing beats a non-existent column for low memory usage
The most memory-efficient column is the one that you never imported in the first place. If you want to build an efficient model, look at each column and ask yourself whether it contributes to the analysis you want to perform. If it doesn’t or you aren’t sure, leave it out. You can always add new columns later if you need them.
Two examples of columns that should always be excluded
The first example relates to data that originates from a data warehouse. In a data warehouse, it’s common to find artifacts of ETL processes that load and refresh data in the warehouse. Columns like “create date”, “update date”, and “ETL run” are created when the data is loaded. None of these columns are needed in the model and should be deselected when you import data.
The second example involves omitting the primary key column when importing a fact table.
Many tables, including fact tables, have primary keys. For most tables, such as those that contain customer, employee, or sales data, you’ll want the table’s primary key so that you can use it to create relationships in the model.
Fact tables are different. In a fact table, the primary key is used to uniquely identify each row. While necessary for normalization purposes, it’s less useful in a data model where you want only those columns used for analysis or to establish table relationships. For this reason, when importing from a fact table, do not include its primary key. Primary keys in a fact table consume enormous amounts of space in the model, yet provide no benefit, as they cannot be used to create relationships.
Note: In data warehouses and multidimensional databases, large tables consisting of mostly numeric data are often referred to as “fact tables”. Fact tables typically include business performance or transaction data, such as sales and cost data points that are aggregated and aligned to organizational units, products, market segments, geographical regions, and so on. All of the columns in a fact table that contain business data or that can be used to cross-reference data stored in other tables should be included in the model to support data analysis. The column you want to exclude is the primary key column of the fact table, which consists of unique values that exist only in the fact table and nowhere else. Because fact tables are so huge, some of the biggest gains in model efficiency are derived from excluding rows or columns from fact tables.
How to exclude unnecessary columns
Efficient models contain only those columns that you’ll actually need in your workbook. If you want to control which columns are included in the model, you’ll have to use the Table Import Wizard in the Power Pivot add-in to import the data rather than the “Import Data” dialog box in Excel.
When you start the Table import Wizard, you select which tables to import.
For each table, you can click the Preview & Filter button and select the parts of the table that you really need. We recommend that you first uncheck all columns, and then proceed to check the columns you do want, after considering whether they are required for the analysis.
What about filtering just the necessary rows?
Many tables in corporate databases and data warehouses contain historical data accumulated over long periods of time. Additionally, you might find that the tables you’re interested in contain information for areas of the business not required for your specific analysis.
Using the Table Import wizard, you can filter out historical or unrelated data, and thus save a lot of space in the model. In the following image, a date filter is used to retrieve only rows that contain data for the current year, excluding historical data that won’t be needed.
What if we need the column; can we still reduce its space cost?
There are a few additional techniques you can apply to make a column a better candidate for compression. Remember that the only characteristic of the column that affects compression is the number of unique values. In this section, you’ll learn how some columns can be modified to reduce the number of unique values.
Modifying Datetime columns
In many cases, Datetime columns take a lot of space. Fortunately, there are a number of ways to reduce the storage requirements for this data type. The techniques will vary depend on how you use the column, and your comfort level in building SQL queries.
Datetime columns include a date part and a time. When you ask yourself whether you need a column, ask the same question multiple times for a Datetime column:
Do I need the time part?
Do I need the time part at the level of hours? , minutes? , Seconds? , milliseconds?
Do I have multiple Datetime columns because I want to calculate the difference between them, or just to aggregate the data by year, month, quarter, and so on.
How you answer each of these questions determines your options for dealing with the Datetime column.
All of these solutions require modification of a SQL query. To make query modification easier, you should filter out at least one column in every table. By filtering out a column, you change query construction from an abbreviated format (SELECT *) to a SELECT statement that includes fully-qualified column names, which are far easier to modify.
Let’s take a look at the queries that are created for you. From the Table Properties dialog box, you can switch to the Query editor and see the current SQL query for each table.
From Table Properties, select Query Editor.
The Query Editor shows the SQL query used to populate the table. If you filtered out any column during import, your query includes fully-qualified column names:
In contrast, if you imported a table in its entirety, without unchecking any column or applying any filter, you’ll see the query as “Select * from ”, which will be more difficult to modify:
Modifying the SQL query
Now that you know how to find the query, you can modify it to further reduce the size of your model.
For columns containing currency or decimal data, if you don’t need the decimals, use this syntax to get rid of the decimals:
If you need the cents but not fractions of cents, replace the 0 by 2. If you use negative numbers, you can round to units, tens, hundreds etc.
If you have a Datetime column named dbo.Bigtable.[Date Time] and you do not need the Time part, use the syntax to get rid of the time:
“SELECT CAST (dbo.Bigtable.[Date time] as date) AS [Date time]) “
If you have a Datetime column named dbo.Bigtable.[Date Time] and you need both the Date and Time parts, use multiple columns in the SQL query instead of the single Datetime column:
“SELECT CAST (dbo.Bigtable.[Date Time] as date ) AS [Date Time],
datepart(hh, dbo.Bigtable.[Date Time]) as [Date Time Hours],
datepart(mi, dbo.Bigtable.[Date Time]) as [Date Time Minutes],
datepart(ss, dbo.Bigtable.[Date Time]) as [Date Time Seconds],
datepart(ms, dbo.Bigtable.[Date Time]) as [Date Time Milliseconds]”
Use as many columns as you need to store each part in separate columns.
If you need hours and minutes, and you prefer them together as one time column, you can use the syntax :
Timefromparts(datepart(hh, dbo.Bigtable.[Date Time]), datepart(mm, dbo.Bigtable.[Date Time])) as [Date Time HourMinute]
If you have two datetime columns, like [Start Time] and [End Time], and what you really need is the time difference between them in seconds as a column called [Duration], remove both columns from the list and add:
“datediff(ss,[Start Date],[End Date]) as [Duration]”
If you use the keyword ms instead of ss, you’ll get the duration in milliseconds
Using DAX calculated measures instead of columns
If you’ve worked with the DAX expression language before, you might already know that calculated columns are used to derive new columns based on some other column in the model, while calculated measures are defined once in the model, but evaluated only when used in a PivotTable or other report.
One memory-saving technique is to replace regular or calculated columns with calculated measures. The classic example is Unit Price, Quantity, and Total. If you have all three, you can save space by maintaining just two and calculating the third one using DAX.
Which 2 columns you should keep?
In the above example, keep Quantity and Unit Price. These two have fewer values than the Total. To calculate Total, add a calculated measure like:
“TotalSales:=sumx(‘Sales Table’,’Sales Table’[Unit Price]*’Sales Table’[Quantity])”
Calculated columns are like regular columns in that both take up space in the model. In contrast, calculated measures are calculated on the fly and do not take space.
Conclusion
In this article, we talked about several approaches that can help you build a more memory-efficient model. The way to reduce the file size and memory requirements of a data model is to reduce the overall number of columns and rows, and the number of unique values appearing in each column. Here are some techniques we covered:
Removing columns is of course the best way to save space. Decide which columns you really need.
Sometimes you can remove a column and replace it with a calculated measure in the table.
You may not need all the rows in a table. You can filter out rows in the Table Import Wizard.
In general, breaking apart a single column into multiple distinct parts is a good way to reduce the number of unique values in a column. Each one of the parts will have a small number of unique values, and the combined total will be smaller than the original unified column.
In many cases, you also need the distinct parts to use as slicers in your reports. When appropriate, you can create hierarchies from parts like Hours, Minutes, and Seconds.
Many times, columns contain more information than you need them too. For example, suppose a column stores decimals, but you’ve applied formatting to hide all the decimals. Rounding can be very effective in reducing the size of a numeric column.
Now that you’ve done what you can to reduce the size of your workbook, consider also running the Workbook Size Optimizer. It analyzes your Excel workbook and if possible, compresses it further. Download the Workbook Size Optimizer.
Источник
Tutorial: Import Data into Excel, and Create a Data Model
Abstract: This is the first tutorial in a series designed to get you acquainted and comfortable using Excel and its built-in data mash-up and analysis features. These tutorials build and refine an Excel workbook from scratch, build a data model, then create amazing interactive reports using Power View. The tutorials are designed to demonstrate Microsoft Business Intelligence features and capabilities in Excel, PivotTables, Power Pivot, and Power View.
Note: This article describes data models in Excel 2013. However, the same data modeling and Power Pivot features introduced in Excel 2013 also apply to Excel 2016.
In these tutorials you learn how to import and explore data in Excel, build and refine a data model using Power Pivot, and create interactive reports with Power View that you can publish, protect, and share.
The tutorials in this series are the following:
Import Data into Excel 2013, and Create a Data Model
In this tutorial, you start with a blank Excel workbook.
The sections in this tutorial are the following:
At the end of this tutorial is a quiz you can take to test your learning.
This tutorial series uses data describing Olympic Medals, hosting countries, and various Olympic sporting events. We suggest you go through each tutorial in order. Also, tutorials use Excel 2013 with Power Pivot enabled. For more information on Excel 2013, click here. For guidance on enabling Power Pivot, click here.
Import data from a database
We start this tutorial with a blank workbook. The goal in this section is to connect to an external data source, and import that data into Excel for further analysis.
Let’s start by downloading some data from the Internet. The data describes Olympic Medals, and is a Microsoft Access database.
Click the following links to download files we use during this tutorial series. Download each of the four files to a location that’s easily accessible, such as Downloads or My Documents, or to a new folder you create:
> OlympicMedals.accdb Access database
> OlympicSports.xlsx Excel workbook
> Population.xlsx Excel workbook
> DiscImage_table.xlsx Excel workbook
In Excel 2013, open a blank workbook.
Click DATA > Get External Data > From Access. The ribbon adjusts dynamically based on the width of your workbook, so the commands on your ribbon may look slightly different from the following screens. The first screen shows the ribbon when a workbook is wide, the second image shows a workbook that has been resized to take up only a portion of the screen.
Select the OlympicMedals.accdb file you downloaded and click Open. The following Select Table window appears, displaying the tables found in the database. Tables in a database are similar to worksheets or tables in Excel. Check the Enable selection of multiple tables box, and select all the tables. Then click OK.
The Import Data window appears.
Note: Notice the checkbox at the bottom of the window that allows you to Add this data to the Data Model, shown in the following screen. A Data Model is created automatically when you import or work with two or more tables simultaneously. A Data Model integrates the tables, enabling extensive analysis using PivotTables, Power Pivot, and Power View. When you import tables from a database, the existing database relationships between those tables is used to create the Data Model in Excel. The Data Model is transparent in Excel, but you can view and modify it directly using the Power Pivot add-in. The Data Model is discussed in more detail later in this tutorial.
Select the PivotTable Report option, which imports the tables into Excel and prepares a PivotTable for analyzing the imported tables, and click OK.
Once the data is imported, a PivotTable is created using the imported tables.
With the data imported into Excel, and the Data Model automatically created, you’re ready to explore the data.
Explore data using a PivotTable
Exploring imported data is easy using a PivotTable. In a PivotTable, you drag fields (similar to columns in Excel) from tables (like the tables you just imported from the Access database) into different areas of the PivotTable to adjust how it presents your data. A PivotTable has four areas: FILTERS, COLUMNS, ROWS, and VALUES.
It might take some experimenting to determine which area a field should be dragged to. You can drag as many or few fields from your tables as you like, until the PivotTable presents your data how you want to see it. Feel free to explore by dragging fields into different areas of the PivotTable; the underlying data is not affected when you arrange fields in a PivotTable.
Let’s explore the Olympic Medals data in the PivotTable, starting with Olympic medalists organized by discipline, medal type, and the athlete’s country or region.
In PivotTable Fields, expand the Medals table by clicking the arrow beside it. Find the NOC_CountryRegion field in the expanded Medals table, and drag it to the COLUMNS area. NOC stands for National Olympic Committees, which is the organizational unit for a country or region.
Next, from the Disciplines table, drag Discipline to the ROWS area.
Let’s filter Disciplines to display only five sports: Archery, Diving, Fencing, Figure Skating, and Speed Skating. You can do this from within the PivotTable Fields area, or from the Row Labels filter in the PivotTable itself.
Click anywhere in the PivotTable to ensure the Excel PivotTable is selected. In the PivotTable Fields list, where the Disciplines table is expanded, hover over its Discipline field and a dropdown arrow appears to the right of the field. Click the dropdown, click (Select All)to remove all selections, then scroll down and select Archery, Diving, Fencing, Figure Skating, and Speed Skating. Click OK.
Or, in the Row Labels section of the PivotTable, click the dropdown next to Row Labels in the PivotTable, click (Select All) to remove all selections, then scroll down and select Archery, Diving, Fencing, Figure Skating, and Speed Skating. Click OK.
In PivotTable Fields, from the Medals table, drag Medal to the VALUES area. Since Values must be numeric, Excel automatically changes Medal to Count of Medal.
From the Medals table, select Medal again and drag it into the FILTERS area.
Let’s filter the PivotTable to display only those countries or regions with more than 90 total medals. Here’s how.
In the PivotTable, click the dropdown to the right of Column Labels.
Select Value Filters and select Greater Than….
Type 90 in the last field (on the right). Click OK.
Your PivotTable looks like the following screen.
With little effort, you now have a basic PivotTable that includes fields from three different tables. What made this task so simple were the pre-existing relationships among the tables. Because table relationships existed in the source database, and because you imported all the tables in a single operation, Excel could recreate those table relationships in its Data Model.
But what if your data originates from different sources, or is imported at a later time? Typically, you can create relationships with new data based on matching columns. In the next step, you import additional tables, and learn how to create new relationships.
Import data from a spreadsheet
Now let’s import data from another source, this time from an existing workbook, then specify the relationships between our existing data and the new data. Relationships let you analyze collections of data in Excel, and create interesting and immersive visualizations from the data you import.
Let’s start by creating a blank worksheet, then import data from an Excel workbook.
Insert a new Excel worksheet, and name it Sports.
Browse to the folder that contains the downloaded sample data files, and open OlympicSports.xlsx.
Select and copy the data in Sheet1. If you select a cell with data, such as cell A1, you can press Ctrl + A to select all adjacent data. Close the OlympicSports.xlsx workbook.
On the Sports worksheet, place your cursor in cell A1 and paste the data.
With the data still highlighted, press Ctrl + T to format the data as a table. You can also format the data as a table from the ribbon by selecting HOME > Format as Table. Since the data has headers, select My table has headers in the Create Table window that appears, as shown here.
Formatting the data as a table has many advantages. You can assign a name to a table, which makes it easy to identify. You can also establish relationships between tables, enabling exploration and analysis in PivotTables, Power Pivot, and Power View.
Name the table. In TABLE TOOLS > DESIGN > Properties, locate the Table Name field and type Sports. The workbook looks like the following screen.
Save the workbook.
Import data using copy and paste
Now that we’ve imported data from an Excel workbook, let’s import data from a table we find on a web page, or any other source from which we can copy and paste into Excel. In the following steps, you add the Olympic host cities from a table.
Insert a new Excel worksheet, and name it Hosts.
Select and copy the following table, including the table headers.
Источник
Excel может анализировать данные из многих источников. Но используете ли вы модель данных, чтобы облегчить себе жизнь? В этом посте вы узнаете, как создать сводную таблицу с использованием двух таблиц с помощью функции модели данных в Excel.
Оглавление
- Что такое модель данных
- Простая задача
- Преимущества модели данных
- Добавить данные в модель данных
- Создание отношений между данными
- Использование модели данных
Содержание
- Что такое модель данных
- Простая задача
- Преимущества модели данных
- Добавить данные в модель данных
- Создание отношений между данными
- Использование модели данных
- Анализировать в Excel – Модель данных отсутствует в Excel – Сообщество Microsoft Power BI
Что такое модель данных
Модель данных Excel позволяет загружать данные (например, таблицы) в память Excel. Он сохраняется в памяти, где вы его не видите. Затем вы можете указать Excel связать данные друг с другом с помощью общего столбца. Часть «Модель» модели данных относится к тому, как все таблицы соотносятся друг с другом.
Старая школа Excel Pro, используйте формулы для создания огромной таблицы, содержащей все данные для анализа. Им нужна эта большая таблица, чтобы сводные таблицы могли служить источником единой таблицы. Тем не менее, создавая отношения, вы избавляетесь от необходимости использовать формулы ВПР, СУММЕСЛИ, ИНДЕКС-ПОИСКПОЗ. Другими словами, вам не нужно собирать все столбцы в одной таблице. Через отношения модель данных может получить доступ ко всей необходимой информации. Даже если он находится в нескольких местах или за таблицами. После создания модели данных Excel сохраняет данные в своей памяти. И, имея его в своей памяти, вы можете получить доступ к данным по-новому. Например, вы можете начать использовать несколько таблиц в одной сводной таблице.
Простая задача
Представьте, что ваш босс хочет иметь представление о продажах, но также хочет знать пол продавца. Ниже представлен набор данных, содержащий одну таблицу с продажами на человека и другую таблицу, содержащую продавцов и их пол. Чтобы проанализировать ваши данные, используйте формулу ПРОСМОТР и составьте большую таблицу, содержащую всю информацию. На следующем этапе вы можете использовать сводную таблицу для суммирования данных по полу.
Преимущества модели данных
Метод And before отлично подходит, когда вы работаете с очень небольшим количеством данных. Тем не менее, у использования функции модели данных в Excel есть преимущества. Вот некоторые преимущества:
- Проверка и обновление формул может быть произвольной при работе с большим количеством таблиц. В конце концов, вам нужно убедиться, что все формулы заполнены до нужной ячейки. И после добавления новых столбцов формулы LOOKUP также необходимо расширить. Модель данных требует совсем немного времени при настройке , чтобы связать таблицу. При настройке используется общий столбец. Однако столбцы, которые вы добавляете позже, автоматически добавляются в модель данных.
- Работа с большими объемами данных часто приводит к очень медленной работе листа из-за вычислений.. Однако модель данных корректно обрабатывает большие объемы данных , не замедляя работу вашей компьютерной системы.
- Excel 2016 имеет ограничение в 1,048,576 строк. Однако количество строк, которые вы можете добавить в память модели данных, практически не ограничено . В 64-битной среде нет жестких ограничений на размер файла. Размер книги ограничен только доступной памятью и системными ресурсами.
- Если ваши данные находятся только в вашей модели данных, вы значительно сэкономите на размере файла .
Добавить данные в модель данных
Теперь вы узнаете, как добавлять таблицы в модель данных. Для начала убедитесь, что ваши данные находятся в таблице. Используя Power Query, вы можете легко загружать таблицы в модель данных.
- Щелкните вкладку Данные -> Щелкните ячейку в нужной таблице для импорта
- Выберите Из таблицы/диапазона
На главной вкладке редактора Power Query
- Выберите Close & Load -> затем Закрыть и загрузить в…
- Выберите Только создать соединение .
- Обязательно установите флажок Добавить эти данные в модель данных
Это добавляет данные в модель данных. Обязательно выполните эти действия для обеих таблиц .
Создание отношений между данными
После добавления данных в модель данных вы можете связать общие столбцы друг с другом. Чтобы создать связи между таблицами:
- Перейдите на вкладку Данные -> выберите Управление моделью данных
Откроется экран Power Pivot.
- Щелкните Представление диаграммы. Это дает вам обзор всех таблиц в модели данных.
- Затем свяжите общий столбец “Продавец” в первая таблица, со столбцом «Продавец» во второй таблице. Вы можете сделать это, щелкнув и перетащив один столбец на другой. Должна появиться связь.
Примечание : Когда вы устанавливаете связь между двумя столбцами, обычно в одном из столбцов указываются уникальные значения. Это называется отношением один-ко-многим . Наличие дубликатов с обеих сторон может привести к ошибке. Для сложных вычислений могут существовать отношения многие-ко-многим (например, в Power BI). Однако это слишком сложная задача, чтобы описать ее в этой статье. Если вас интересуют эти темы, обязательно исследуйте «Отношения« многие ко многим ».
Использование модели данных
Теперь мы подошли к самому интересному.. Чтобы использовать модель данных в сводной таблице, выполните следующие действия:
- Перейдите на вкладку Вставить -> нажмите Pivot Таблица
Появится всплывающий экран «Создать сводную таблицу». Поскольку у вас есть модель данных, теперь вы можете выбрать использование ее в качестве источника данных.
- Нажмите Использовать модель данных этой книги
Теперь в полях сводной таблицы вы увидите все возможные источники данных для вашей сводной таблицы. Желтый значок базы данных в правом нижнем углу отмеченных таблиц показывает, что она является частью модели данных Excel.
Поскольку две таблицы связаны друг с другом, вы можете использовать поля из обеих таблиц в одной сводной таблице! Прочтите предыдущее предложение еще раз. Разве это не потрясающе ?? В примере ниже используются поля «Продажи» и «Продавец» из таблицы ProductSales, а поле «Пол» – из другой таблицы. И цифры по-прежнему верны!
Используя модель данных, вы можете анализировать данные из нескольких таблиц одновременно . И все это без использования формул ПРОСМОТР, СУММЕСЛИ или ИНДЕКС ПОИСКПОЗ для выравнивания исходной таблицы. Тем не менее, анализируемые данные также могут поступать из базы данных, текстового файла или облачного хранилища. Возможности безграничны.
Чтобы еще больше свести к минимуму использование формул LOOKUP, обратите внимание на Power Query. На моем сайте есть несколько статей об этом. Например, вы можете прочитать, как использовать Power Query для создания уникальных комбинаций или для преобразования столбцов с накоплением .
Я произвел некоторые преобразования и добавил еще несколько столбцов в свою модель данных.
Теперь мне нужно экспортировать эти данные в файл CSV из модели данных, как мне сделать это, Рик? У меня 7,5 миллионов записей.
Ответ
Привет, Рик! – Спасибо, что поделились!
У меня к вам вопрос, надеюсь, вы сможете ответить:
У меня есть файл CSV с 2 мил. строки (записи GL с транзакциями за каждый день). Я использую Power Query для подключения к файлу и добавления в Datamodel.
Если я ничего не сделаю, Datamodel должен обработать 2 миллиона. строк.
Если я сделаю группировку с агрегированием суммы в месяц в Power Query, тогда будет только 80 тысяч строк.
Будет ли это преимуществом, сделайте это быстрее в модели данных , чтобы использовать PowerQuery для такого агрегирования?
Ответ
Привет, Рик, спасибо за ответ. На данный момент я только пытаюсь создать информационный список. Хотя я понял это; когда я объединяю их в Power Query, он определяет уникальный ключ цветового кода и дает мне то, что я ищу. Большое спасибо!
Ответ
У меня есть 5 списков в Sharepoint на основе производственных частей, которые я хочу использовать в модели данных (сначала попробуйте это).
Я только начинаю с двух из них: «Основные части» и «Цветовые коды».. Я подтвердил, что столбец «Цветовой код» в списке «Цветовые коды» уникален (2000 уникальных кодов). В списке «Основные детали» около 1800 номеров деталей. Объединение происходит по «Цветовому коду», который есть в каждом списке. Когда я пытаюсь извлечь описание цвета из списка цветовых кодов, я получаю сообщение о том, что отчет сводной таблицы не помещается на листе – он пытается назначить каждый цветовой код каждому отдельному номеру детали, как будто нет реляционной связи между Столбцы цветового кода в каждом списке, но они явно есть в моей модели данных. Какие-либо предложения? На первом этапе кажется очевидным, что…
Ответ
Привет, Рик,
Ваша статья ясна, проста и легка для понимания.
Я прочитал много статей о модели данных и Power Pivot, но ваша статья действительно проста.
У меня к вам вопрос.
Я создал панель мониторинга в формате xlsb и вставил множество срезов, сводных таблиц и графики.
Две таблицы, из которых берутся данные, состоят из 200 тыс. строк, но они всегда растут неделя за неделей.
Каждую неделю мне приходится преобразовывать данные в таблицы, потому что источники таких данные разные (SAP, Coupa), и, кроме того, я вношу в них некоторые дополнительные изменения.
Теперь я заметил, что время загрузки модели данных слишком сильно увеличивается, и я ищу способ сделать запросы быстрее.
Я сохранил файл как xlsb. Я также удалил исходные данные (изначально я помещал таблицы в тот же файл, что и панель мониторинга на разных листах): после обновления исходных данных и обновления панели мониторинга я использую для удаления листов, на которых были исходные данные, чтобы уменьшить размер файла. На данный момент размер файла составляет 20 МБ (xlsb).
Основная проблема – время для загрузки модели данных. Все еще слишком много.
Я еще не использовал power query/pivot, потому что эта панель инструментов используется многими пользователями, и, если я хорошо помню, всем им следует активировать эту функцию, чтобы панель работала нормально. Это может быть очень сложно управлять.
Я уже пытался не использовать функции.
Исходный источник данных с множеством столбцов и все функции в нем сохранены в другом файле. Затем я помещаю в тот же файл, где находится панель управления, но на другом листе, только те столбцы, которые мне действительно нужны для работы.
Как сказано выше, после обновления сводных таблиц и графиков я удаляю исходные данные (сохраненные в другом файле Excel).
Итак, есть ли у вас предложения, чтобы ускорить запросы?
Спасибо,
Майкл
Ответить
Привет, Рик. Спасибо за то, что уделили время написанию этого.
Итак, я в основном застрял на том факте, что у меня есть рабочая книга, которая добавляет и вычисляет столбцы и меры.
Теперь … я хочу используйте эту модель данных в ДРУГОМ файле excel. Соединение должно обновляться автоматически, поскольку оба файла находятся на Sharepoint.
Мой вопрос заключается в том, могу ли я использовать вычисляемые столбцы и проводить измерения из одной «пустой» книги (модель данных) в другой книге, поэтому я можно создать там новую сводную таблицу.
Есть шансы?
Спасибо,
Сантьяго из Перу
Ответ
Привет, Рик,
Надеюсь, ты поможешь с моим вопросом. У меня есть данные, которые повторяются через годы. Я отметил это стрелкой на картинке. Вот ссылки на файл Excel.
https://www.dropbox.com/scl/fi/1xxmqyb9a0vwpj00mfkgj/Sample.xlsx?dl=0&rlkey=n2zc09cvc7gzxgv0p3g9kwi70
https://www.dropbox.com/s/hpcmtf6q1rfehwl/Capture.PNG?dl=0
https://www.dropbox.com/s/418zg5uupy6g3wj/Capture2.PNG? dl = 0
Стоимость печати должна быть указана только за один год, а не за три года. Все остальные данные верны: гонорар тренера, гонорар эксперта, плата за номер и плата за питание и питание.
Спасибо,
K
Ответить
У меня есть информационная панель, заполненная сводными таблицами, которые заполняются моделью данных. Я хочу включить срезы для фильтрации данных. Если я затем отправлю файл кому-то, у кого нет доступа к исходному источнику данных, будут ли срезы работать для этого человека? Или они получат ошибку, потому что Excel и модель данных больше не могут найти источник данных? (Я знаю, что они не могут обновить модель данных, я просто беспокоюсь о просмотре того, что я уже заполнил, прежде чем отправлять им)
Ответ
не работает для меня! В модели данных все дублируется между двумя таблицами! Итак, у меня есть 99 единичных строк в таблице 1 и 99 уникальных строк в таблице 2, так что есть отображение 1-1. Таблица первая. Я переместил один столбец из таблицы 1 в таблицу 2 и попытался объединить два, используя модель данных, и все, что он делает, повторяет 99 полей из таблицы 2 под ключом в таблице 1 – vlookups намного проще. Кроме того, у меня возникают всевозможные проблемы с памятью, поэтому он не так хорош, как vlookups для больших наборов данных.
Ответ
Так что в основном Excel становится больше похожим на Access?
Ответить
Это было моей мыслью, когда я узнал больше об этом инструменте, особенно после того, как увидел Отношения.
Ответ
Спасибо, отличная информация
Ответ
Одна важная вещь, которая мне нравится в моделях данных, – это дополнительные функции, которые вы можете использовать в сводных таблицах, особенно «Уникальные счетчики».
Ответ
Анализировать в Excel – Модель данных отсутствует в Excel – Сообщество Microsoft Power BI
Привет всем –
I Я пытаюсь использовать «Анализировать в Excel», чтобы перенести мою модель данных Power BI в Microsoft Excel для создания отчетов для моих клиентов (которые предпочитают работать в Excel). Я успешно сохранил файл Excel с подключением pbiazure из службы Power BI и построил сводную таблицу. Однако, когда я пытаюсь щелкнуть «Управление моделью данных» в Excel, чтобы увидеть взаимосвязи (которые, как я ожидаю, будут такими же, как для рабочего стола Power BI), модель данных не отображается и остается пустой.
Кто-нибудь знает, почему это так? В случае, если он напрямую подключен к набору данных в службе Power BI, я предполагаю, что он сможет отображать и редактировать модель данных непосредственно в Excel..
Может ли кто-нибудь пролить свет на то, почему отображается пустой экран без модели данных?
Привет, @ sviswan2!
Параметр «Управление моделью данных» в Excel будет отображать модель данных только при подключении источника данных в Excel. Модель данных создается автоматически при одновременном импорте двух или более таблиц из базы данных. Когда вы импортируете одну таблицу, вы можете выбрать «добавить эти данные в модель данных». См. Эту статью: Advanced Excel – модель данных
В этом выпуске «Анализировать в Excel» просто цитирует набор данных из службы power bi, а не как единый источник данных, этот набор данных взят из вашего. pbix, который включает отношения и т. д., поэтому он не будет использоваться в качестве единственного источника данных для добавления в модель данных в Excel.
Другими словами, сам набор данных был моделью, вы Вы можете управлять им на своем рабочем столе power bi, а не в Excel, чтобы воссоздать модель.
С уважением,
Инцзе Ли
Если этот пост помогает, то, пожалуйста, рассмотрите вариант “Принять его” как решение, которое поможет другим участникам быстрее его найти.
Привет @ v-yingjl –
Спасибо за пояснение, которое немного помогает понять. Поэтому, пожалуйста, поясните следующее:
1) Если модель данных не импортирована, будут ли работать все отношения между данными, которые я настроил в файле рабочего стола, когда я использую его как «Анализировать в Excel “?
2) Если я хочу добавить какую-либо связь или меру, я должен сначала сделать это на рабочем столе Power BI, опубликовать в службе, а затем он должен появиться в моем файле Excel?
спасибо!
Привет @ sviswan2,
- Да, «Анализировать в excel» цитирует набор данных в сервисе power bi, отношения сохранятся.
- Если вы хотите добавить взаимосвязь или меру, у вас есть сделать это сначала на рабочем столе power bi, затем опубликовать в сервисе и повторно использовать «Анализировать в Excel», хотя вы не можете видеть взаимосвязь и конкретную формулу меры, вы можете видеть только поля таблицы и значение меры в excel.
С уважением,
Инцзе Ли
Если этот пост поможет, пожалуйста, примите его как решение чтобы помочь другим участникам найти его быстрее.
Привет @ sviswan2,
Анализировать в Excel позволяет взаимодействовать с набором данных из Power BI, но он имеет только соединение с набором данных, он не имеет данных из модели.
Вот ссылка: https://docs.microsoft.com/en-us/power-bi/collaborate-share/service-analyze-in-excel
“Вы можете сохранить книгу Excel вы создаете с помощью набора данных Power BI, как и любую другую книгу. Однако вы не можете публиковать или импортировать книгу обратно в Power BI, потому что вы можете публиковать или импортировать в Power BI только те книги, которые имеют данные в таблицах или имеют модель данных.. Поскольку новая книга просто подключается к набору данных в Power BI , публикация или импорт в Power BI будет происходить по кругу “.