SQL column
Summary of basic knowledge of SQL database
Summary of advanced knowledge of SQL database
Conversion
The conversion of Power BI is mainly for editing rows and columns, including grouping, transposing, reversing rows, counting, data replacement, and so on. It also belongs to the category of data editing and involves more functions. Today we first explain the conversion of the table.
Example
Still taking the Customers1 table as an example, the specific table structure and data are as follows:
Conversion table
The operation of the conversion table is based on grouping, using the first row as the title, transposing, reversing rows and counting.
Group by
Group the rows in the table according to the currently selected column, the specific operations are as follows.
After entering the edit query interface, click the group query under the conversion menu, as shown in the figure below:
The results obtained are as follows:
Use the first row as the title
Generally, when we import an Excel file, the first row will display the title of the data, but no operation is done when importing it. Power BI will not display the first row as the title of the data by default, as shown below:
We choose to use the first row as the heading, then the column headings of the first row will be raised, as shown in the following figure:
↓↓↓
Transpose
Like Excel's row and column transposition, you can transpose the rows and columns of the table.
Reverse row
reverses the rows of the table so that the last row is displayed as the first row. The difference with sorting is that it does not sort, but only reverses the rows.
count
Count the rows in the current table and display the number of rows directly.
Conversion column
The common conversions of columns include data type conversion, renaming column names, replacing values, filling, pivoting columns and inverse pivoting columns, etc.
Convert data type
Similar to the modified data format in Excel, you can modify the data into various formats you need. The following figure shows some common data types that can be converted.
Rename: modify the column name
Replacement value : Replace the data that needs to be replaced in the selected column
filling
Divided into downward filling and upward filling, we give a specific example for easy understanding
Similarly, if we click to fill up, the result is as follows
Perspective column
Similar to the pivot table in Excel, select a column to pivot to other columns
The perspective column has the following options:
For example, if we select a city, we have a perspective on customers, and take the number of customers. The result is as follows:
Inverse perspective column
Convert all columns except the currently unselected column to attribute value pairs, the specific operation is as follows:
annotation
The conversion of tables and columns can solve some common problems about tables and columns, whether it is grouping columns, counting rows, or pivoting columns, etc., it is very convenient for us to have a clear view of the data in the table Awareness.