0% found this document useful (0 votes)
2 views

Answers_Working with Filters and Parameters

The document provides a step-by-step guide for filtering and managing data in Power BI using Power Query. It includes instructions for filtering by position, date of birth, and salary, as well as sorting and removing duplicates. Additionally, it covers creating a parameter for department selection and filtering data based on that parameter before loading it into Power BI.

Uploaded by

toxictriceps
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Answers_Working with Filters and Parameters

The document provides a step-by-step guide for filtering and managing data in Power BI using Power Query. It includes instructions for filtering by position, date of birth, and salary, as well as sorting and removing duplicates. Additionally, it covers creating a parameter for department selection and filtering data based on that parameter before loading it into Power BI.

Uploaded by

toxictriceps
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Working with Filters and Parameters

Assignment 1

Q1 Filter all rows in the dataset that contain the text "Manager" in the "Position" column.

Step 1 Open the Power Query Editor by going to Home > Get Data > browse and select the "Data 8.1"
file in Power BI Desktop. (Select "Table 1" and transform data)
Step 2 Go to the "Position" column.

Step 3 Right-click on the header and select "Filter" > "Text Filters" > "Contains".
Step 4 Enter "Manager" as the value to filter by and click OK.
Q2 Filter all rows in the dataset that have a "Date of Birth" after January 1st, 1990.

Step 1 Go to the "Date of Birth" column.

Step 2 Right-click on the header and select "Filter" > "Date Filters" > "After".

Step 3 Enter "01/01/1990" as the value to filter by and click OK.


Q3 Filter all rows in the dataset where the "Salary" is greater than $70,000.

Step 1 Go to the "Salary" column.


Step 2 Right-click on the header and select "Filter" > "Number Filters" > "Greater Than".
Step 3 Enter "70000" as the value to filter by and click OK.
Q4 Sort all rows in the dataset by "Salary" in descending order.

Step 1 Right-click on the "Salary" column header and select "Sort Descending".
Step 2 Go to the Home tab and select "Close & Apply" to apply the changes to the data source.

Step 3 The Queries are updated in the report view screen and it can be seen in the fields tab.
Assignment 1

Q1 Import the data into Power Query: Name Position Department Salary
Step 1 Open the Power Query Editor by going to Home > Get Data >select the appropriate data source

(EXCEL FILE) > browse and select the "Data 8.2" file in Power BI Desktop.

Step 2 Select "Table 1" and transform data in the navigator dialogue box.
Q2 Remove any duplicate records in the data.

Step 1 In the Power Query Editor, select the data and click Remove Rows.

Step 2 Select Remove Duplicates.

Step 3 In the Remove Duplicates dialogue box, select the columns you want to use to identify duplicates
and click OK.
Q3 Create a parameter named "Department" that allows users to select a department from a

dropdown list.

Step 1 In the Power Query Editor, go to the home tab and click on Manage Parameters.

Step 2 In the Manage Parameters dialogue box, click on New Parameter.

Step 3 In the New Parameter dialogue box, enter the name "Department" and select a data type.

Step 4 Under Possible Values, select List of values and enter the departments that you want to be
available in the dropdown list.
Step 5 Click OK.

Q4 Connect the parameter to the data in Power Query to only show data for the selected

department.

Step 1 In the Power Query Editor, select the data and click Home.
Step 2 Click on the “Add Column” tab> “Conditional Column”.
Step 3 In the Conditional Column dialogue box, enter a new column name and select the "Department"

parameter.

Step 4 Under Then, select the "Department" column from the data.

Step 5 Under Else, leave the field blank.


Step 6 Click OK.
Q5 Filter the data based on the selected department:(Technology)

Step 1 In the Power Query Editor, select the newly created "Department" parameter query.

Step 2 In that provide the current value as "Technology".

Step 3 A new column was created for "new department" only filtered with "technology" in the main

query.
Q6 Close and Load the data into Power BI: Report view screen.

Step 1 In the Power Query Editor, select the data and click Close & Load.

Step 2 In Power BI Desktop, the data will now only show records for the selected department.

You might also like