Identify Column Headers and Names
Indeed, the first step in shaping your initial data involves identifying the column headers and names within the data. Thereafter, you should evaluate where they are located to make sure they are placed correctly. Let us suppose the source data in the given below csv file for SalesTarget had a target categorized according to products and a subcategory split by months, both of which are organized into columns.
However, you may observe the data is difficult to read. Since, the data in its current state has column headers placed in different rows (marked in red), and several columns have undescriptive names, such as Column1, Column2, and more. Thus, after identifying where the column headers and names are located, you can make changes to reorganize the data.
Steps to promote column header
- Firstly, when you create a table in Power BI Desktop, Power Query Editor assumes that all data belongs in table rows.
- However, a data source might have a first row that contains column names
- Next, to correct this inaccuracy, you need to promote the first table row into column headers.
- Lastly, we can promote headers by selecting the Use First Row as Headers option on the Home tab. Else, by selecting the drop-down button next to Column1 and then selecting Use First Row as Headers.
Steps to rename columns
- The first step in shaping your data is to examine the column headers.
- There can be cases when you find one or more columns have the wrong headers, or a header with a spelling error or the header naming convention is not consistent or user-friendly.
- Now, with the Use First Row as Headers feature in the illustration.
- Here, the column that contains the subcategory Name data now has Month as its column header.
- Since this column header is incorrect, so it needs to be renamed.
- We can rename column headers by right-clicking the header, select Rename, edit the name, and then press Enter.
- Else, you can double-click the column header and overwrite the name with the correct name.
- Lastly, we can also work around this issue by removing (skipping) the first two rows and then renaming the columns to the correct name.