1. Introduction

This week’s challenge requires us to build an interactive dashboard using parameters to select between key metrics in Power BI. The data contains performance measures of two baseball batters (Cabrera and Pujols) including the number of games played, hits per game, hits, home runs, and at bat per home run.


2. The Solution

First, let’s create a “Card” visualisation to display the key metrics for the two batters, as summarised in the screenshot.

Copy and paste the card and filter the data to the batter Pujols and adjust the format.

Now let’s create the parameter. To do this, select the Modelling tab, click on New Parameter, and select the appropriate fields as summarised below.

Click on the parameter, go to the format visual, select visual, slicer settings, and select the tile as the style. Rearrange the parameter to be displayed on top of the screen as shown below.

Now let’s create a line chart to observe the trends in these metrics by player and year. Select the line chart and choose the following setting as summarised in the screenshot, with the key step in placing the created Parameter in the Y-axis.

Now we have the interactive dashboard, where the user can select the key metrics to explore which will be displayed on the line chart.

The Data School
Author: The Data School