Power BI basics-conversion tables and columns

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:

Power BI basics-conversion tables and columns

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:

Power BI basics-conversion tables and columns

The results obtained are as follows:

Power BI basics-conversion tables and columns

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:

Power BI basics-conversion tables and columns

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:

Power BI basics-conversion tables and columns

↓↓↓

Power BI basics-conversion tables and columns

Transpose

Like Excel's row and column transposition, you can transpose the rows and columns of the table.

Power BI basics-conversion tables and columns

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.

Power BI basics-conversion tables and columns

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.

Power BI basics-conversion tables and columns

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

Power BI basics-conversion tables and columns

Similarly, if we click to fill up, the result is as follows

Power BI basics-conversion tables and columns

Perspective column

Similar to the pivot table in Excel, select a column to pivot to other columns

The perspective column has the following options:

Power BI basics-conversion tables and columns

For example, if we select a city, we have a perspective on customers, and take the number of customers. The result is as follows:

Power BI basics-conversion tables and columns

Inverse perspective column

Convert all columns except the currently unselected column to attribute value pairs, the specific operation is as follows:

Power BI basics-conversion tables and columns

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.

Guess you like

Origin blog.51cto.com/15057820/2655143