4 easy steps to create a Dynamic KPI in Power BI

Shashanka Shekhar
Microsoft Power BI
Published in
6 min readFeb 26, 2024

--

Power BI is a platform that allows you to connect to various data sources, transform and model your data, and create interactive dashboards and reports. Power BI can help you gain insights from your data and communicate them effectively.

What is a KPI?

A KPI, or a key performance indicator, is a measurable target that shows how well an individual or a business is performing in terms of meeting their goals. KPIs can be financial, such as net profit or revenue, or nonfinancial, such as customer satisfaction or retention. KPIs help organizations track their progress, identify their strengths and weaknesses, and make informed decisions to improve their outcomes.

Photo by Adeolu Eletu on Unsplash

Building the KPI

We will be making this KPI:

Here we will use a slicer to show Total Sales, Maximum Sales or Average Sales in the KPI card for which we first need to calculate these Measures then create a SWITCH case to dynamically select the measure and then finally create Measure Names to add in the slicer and control the KPI card with it.

1.DAX to calculate required measures:

Total Sales = SUM(ecommerce_data[sales_per_order])

--

--

Shashanka Shekhar
Microsoft Power BI

Contributor for Microsoft Power BI. I like Data Analysis and Data Science. Also I enjoy sports, videogames and Japanese Anime in my free time.