Microsoft Power BI Complete Reference
上QQ阅读APP看书,第一时间看更新

Renaming tables and columns

The renaming of tables and columns is an important step in making your data model easy to use. Different departments often have different terms for the same entity, therefore it is important to consider multiple departments when renaming objects. For example, you may have a column with a list of customer names and you decide to name this column Customer. However, the sales team may have named that column Prospect or Client, or any number of other terms. Remember to keep your end users and consumers of your reports in mind when renaming tables and columns.

You may rename tables or columns in the report, data, or relationship view. Navigate to the relationship view and right-click on FactInternetSales, then select Rename:

Figure 21-Renaming FactInternetSales

Rename this table to Internet Sales. Now, rename the other tables, removing the Dim prefix and adding spaces where applicable. You can use the table here for reference:

 

The next step is necessary, but could be a somewhat tedious process. If you come from a programming or development background, then you are used to eliminating spaces in table and column names. End users and consumers of reports will expect to see spaces and, for that reason, it is recommended to add spaces where applicable. Spaces need to be added to any column that is visible, not hidden, in the report view. To rename a column, right-click on it and then select Rename. In the following screenshot, spaces have been added to SalesOrderNumber and SalesOrderLineNumber.

Complete the following steps to rename the rest of your columns:

  1. Repeat this process of adding spaces for the remaining columns in each table
  2. Rename FullDateAlternateKey to simply Date:
Figure 22-Renaming columns in each table