Answers_Working with Filters and Parameters
Answers_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 2 Right-click on the header and select "Filter" > "Date Filters" > "After".
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 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 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 1 In the Power Query Editor, select the newly created "Department" parameter query.
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.