Skip to content
Home » Power BI Exercise » Power BI Exercise – Create a Dynamic Measure Selector

Power BI Exercise – Create a Dynamic Measure Selector

5/5 - (2 votes)

Learn how to create a Dynamic measure selector in Power BI. This exercise includes adding a slicer to toggle between SalesAmount and Profit, enabling dynamic updates to the chart based on the selected measure for enhanced interactivity.

Tasks:

  1. Create a slicer that allows users to select either SalesAmount or Profit.
  2. Dynamically update the chart based on the selected measure.

Solution:

Load the below dataset into Power BI-

Sales Dataset

Product SalesAmount Profit
Laptop 50000 15000
Smartphone 30000 10000
Printer 15000 5000
Headphones 20000 6000
Tablet 25000 8000

Create a slicer that allows users to select either SalesAmount or Profit-

Step- 1: Add two measures: one for Sales and one for Profit. Right-click on the Sales dataset and select New Measure.

Total Sales = SUM(Sales[SalesAmount])
Total Profit = SUM(Sales[Profit])

Step-2: Create a Field Parameter Slicer by going to the Modeling tab, clicking on the New Parameter dropdown, and selecting Fields.

Add fields parameter
Add fields parameter



Step-3: Set the options below. Ensure that the Fields are selected, and provide the parameter name as Select Measure. After that, select both measures.

Make sure the Add slicer to this page checkbox is selected, and then click the Create button.

Set the parameter options
Set the parameter options

Step-4: Now select the slicer, go to the Format tab, open the Slicer settings, and turn on Single Select in the Selection section.

Change slicer selection to single select
Change slicer selection to single select

Dynamically update the chart based on the selected measure-

Add a clustered column chart to the report page. In the X-axis, add Product, and in the Y-axis, Select a measure.

After that, to check the result, choose a measure from the slicer.

Result of Field Parameter
Result of Field Parameter

I hope you enjoyed this Power BI exercise.

Loading

Leave a Reply

Discover more from Learn BI

Subscribe now to keep reading and get access to the full archive.

Continue reading