Power BI - Preparing, cleaning and transforming your Data Tutorial

In this video, you will learn about the intelligent search feature in Microsoft 365. The video covers the search tools in Microsoft 365, including searching on your computer, using Microsoft Search, finding content and people, searching your emails, and more.
This will help you save time and easily find all your information in the Microsoft 365 suite.

  • 4:42
  • 4121 views

Objectifs :

This video aims to demonstrate how to utilize various features in Query Editor to prepare a dataset for reporting in Power BI. It covers data importation, formatting, and manipulation techniques necessary for effective data analysis.


Chapitres :

  1. Introduction to Query Editor
    In this section, we will explore the functionalities of Query Editor in Power BI. The focus will be on preparing a dataset that consists of 704 rows, which will be used to generate a report. Often, imported data is not formatted correctly or is not ready for analysis.
  2. Importing and Preparing Data
    To begin, we will import the dataset. A common issue is that the Country column may only have the first line of each section filled. To ensure Power BI can analyze sales by country, we will use the 'Fill Down' feature found in the Transform tab.
  3. Handling Null Values
    After filling down, there may still be rows with null values in the header of each section. To remove these, right-click on a null value and select 'Does Not Equal' to delete it. Power BI will automatically detect the data type, such as number or whole number.
  4. Filtering Data
    Since we are only interested in European sales, we will delete the rows that list US sales, which range from row 561 to row 700, totaling 140 lines. This can be done using either the 'Keep Rows' command or the 'Remove Rows' command.
  5. Selecting Relevant Columns
    For our analysis, we will focus on the Month Number, Month Name, and Date columns. These can be selected by holding down the Ctrl key and clicking on the desired columns under the Home tab.
  6. Splitting Columns
    To split a column into several columns, we can use the 'Split Column' command and choose 'By Delimiter.' Power BI will automatically detect the delimiter, or you can select one from the list. Alternatively, you can create new columns from existing ones using the 'Column From Examples' feature.
  7. Replacing Values
    To change the manufacturing value of a product, select the cell with the value to be changed, then use the 'Replace Values' command under the Home tab. Enter the new value and confirm by clicking OK.
  8. Adding Calculated Columns
    If a column for actual sales is missing, we can add it by naming the column and entering a formula that calculates actual sales by subtracting the discount value from the sales total. If errors occur in the formula, they can be corrected before confirming.
  9. Creating Conditional Columns
    To indicate a gain, we will create a final column using the 'Conditional Column' command, which functions similarly to the IF function in Excel. We will set the condition to check if the Profit column is greater than 0, outputting 'Yes' for gains and 'No' otherwise.
  10. Finalizing the Dataset
    Once all edits are made, we will apply the changes by clicking on 'Close & Apply' under the Home tab. It is important to note that most features in Query Editor can also be accessed by right-clicking with the mouse.

FAQ :

What is Query Editor in Power BI?

Query Editor is a tool in Power BI that allows users to transform and prepare their data for analysis. It provides various features to clean, reshape, and modify datasets before they are used in reports.

How do I import data into Power BI?

To import data into Power BI, you can use the 'Get Data' option on the Home tab. Select the data source you want to import from, and follow the prompts to load your dataset into Power BI.

What should I do if my imported data is not properly formatted?

If your imported data is not properly formatted, you can use the features in Query Editor to clean and transform the data. This includes filling down values, changing data types, and removing unnecessary rows.

How can I delete specific rows in Query Editor?

You can delete specific rows in Query Editor by using the 'Remove Rows' command. You can choose to remove rows based on their position or specific criteria.

What is the purpose of the Conditional Column feature?

The Conditional Column feature allows you to create a new column based on specific conditions. It functions similarly to the IF function in Excel, enabling you to categorize data based on defined criteria.

How do I calculate actual sales in Power BI?

To calculate actual sales in Power BI, you can create a new column that subtracts the discount value from the total sales. This can be done using a formula in the new column.


Quelques cas d'usages :

Sales Data Analysis

Using Query Editor to clean and prepare sales data for analysis in Power BI. This includes removing irrelevant rows, filling down missing values, and calculating actual sales to gain insights into sales performance.

Monthly Reporting

Preparing a monthly sales report by transforming the dataset to include only relevant columns such as Month Number, Month Name, and Actual Sales. This allows for efficient reporting and analysis of sales trends over time.

Data Quality Improvement

Utilizing Query Editor to enhance data quality by identifying and removing null values, correcting data types, and ensuring that the dataset is ready for accurate analysis and reporting.

Profitability Analysis

Creating a profitability analysis report by adding a Conditional Column to indicate whether sales resulted in a gain or loss. This helps businesses make informed decisions based on profit margins.

Data Transformation for Marketing Insights

Transforming marketing data to analyze the effectiveness of campaigns by filtering out irrelevant data, calculating actual sales, and preparing the dataset for visualization in Power BI dashboards.


Glossaire :

Query Editor

A tool in Power BI used for data transformation and preparation before analysis.

Dataset

A collection of data that is used for analysis and reporting.

Transform tab

A section in Query Editor where users can apply various data transformation operations.

Fill Down

A command used to fill empty cells in a column with the value from the cell above.

Data Type

The classification of data in a column, such as number, text, or date.

Remove Rows

A command used to delete specific rows from a dataset based on certain criteria.

Split Column

A feature that allows a single column to be divided into multiple columns based on a delimiter.

Conditional Column

A feature that creates a new column based on conditions, similar to the IF function in Excel.

Actual Sales

The total sales amount after deducting any discounts.

Discount Value

The amount subtracted from the total sales price.

00:00:06
in Query Editor to prepare the dataset that
00:00:08
will be used to produce a report.
00:00:11
Let's begin by importing data.
00:00:13
In this example, I'm going to use an Excel file for sales management
00:00:17
that contains 704 rows.
00:00:22
As we mentioned previously, most of the time,
00:00:24
imported data is not properly formatted or is not ready to use.
00:00:29
For instance, in the Country column,
00:00:31
only the first line of each section contains the name of the country.
00:00:35
For Power BI to analyze sales by country,
00:00:38
I need to fill in each row with the corresponding value.
00:00:41
To do so, I go to the Transform tab and then I use Fill, Descending.
00:00:47
There are still a few rows in the header of each section that contain null values.
00:00:52
I right click on one of these values,
00:00:54
then on Text Filters and then on Does Not Equal to delete it.
00:00:59
You will notice that Power BI automatically detects the data type
00:01:03
such as text, decimal number or whole number.
00:01:06
To change the data type in a column, simply select the column
00:01:10
and then choose Data Type under the Home tab.
00:01:14
I am interested only in European sales,
00:01:17
I will therefore delete the rows that list US sales.
00:01:21
These rows start at row 561 and end at row 700,
00:01:25
which gives us 140 lines.
00:01:28
There are two ways to delete them.
00:01:30
Either you can use the Keep Rows command then Keep Top Rows
00:01:34
and specify the number of rows to keep such as 561,
00:01:38
or you can use the Remove Rows command, then Remove Bottom Rows
00:01:43
and specify the number of rows to delete,
00:01:45
which is 140 in our case.
00:01:49
The Month Number, Month Name and Years columns are not useful to me
00:01:53
as the Date column is all I need for now.
00:01:56
I select these columns by holding down the Ctrl key,
00:02:00
and then I choose Remove Columns under the Home tab.
00:02:04
You can also split a column into several columns.
00:02:07
Let's use our date example once again;
00:02:10
there are a few methods that you can use.
00:02:12
Let's start with the Split Column command and choose By Delimiter.
00:02:17
Power BI will automatically detect the delimiter,
00:02:20
otherwise you can use the list to choose one.
00:02:23
The second method is to create several columns starting from this one.
00:02:28
Go to the Add Column tab and choose Column From Examples
00:02:32
and then From Selection.
00:02:34
Double click on one of the cells in the new column.
00:02:37
Power BI will display all the available choices.
00:02:41
Select the one that suits you best.
00:02:43
You can see that the column has been filled in,
00:02:46
click on OK to confirm the creation of this new column.
00:02:51
I now want to change the manufacturing value of this product
00:02:54
in the Manufacturing Price column.
00:02:56
To do so, I select a cell that contains the value to be changed,
00:03:00
next, under the Home tab I use the Replace Values command.
00:03:04
I enter the new value and I confirm the information by clicking on OK.
00:03:10
While looking at my chart, I notice that it was missing a column for actual sales.
00:03:14
To add this column, I'm going to use the Custom Column command
00:03:18
under the Add Column tab.
00:03:20
I give my column a name and then I enter my formula.
00:03:25
The actual sales are calculated by subtracting
00:03:28
the discount value from the sales total.
00:03:30
By double clicking on the names of the columns to add them,
00:03:33
I can see that no errors were found in my formula.
00:03:37
I can now confirm by clicking on OK.
00:03:40
I'm going to change the type of my column
00:03:45
and then place it after the Discounts column.
00:03:49
To make it easier to analyze the data,
00:03:51
I'm going to create a final column that will display Yes to indicate a gain
00:03:56
and No to indicate a loss.
00:03:59
To do so, I can use the Conditional Column command.
00:04:03
This command corresponds to the IF function in Excel.
00:04:07
I select the Profit column,
00:04:09
I define "is greater than" as an operator,
00:04:13
"0" as a value, "Yes" in Output and "No" in Otherwise.
00:04:22
The dataset is now ready to be analyzed.
00:04:25
All that remains is to apply the edits that we made
00:04:27
by clicking on Close Apply under the Home tab.
00:04:34
Finally, most of the features offered by Query Editor are
00:04:37
also available by right clicking with your mouse.

No elements match your search in this video....
Do another search or back to content !

 

Mandarine AI: WHAT YOU SHOULD KNOW

Reminder

Show