How to create a field parameter in Power BI – TechRepublic

How to create a field parameter in Power BI – TechRepublic

How to create a field parameter in Power BI
Your email has been sent
Having too many slicers is almost as bad as not having enough. When slicers are cluttering your Power BI dashboard, consider replacing them with parameters.
Slicers and filters are great tools for the Power BI end user, but they’re a bit limited. You can’t add just any column to a slicer or filter and then take up space, so what alternatives are available?
In 2022, Power BI added parameters, which let designers combine columns from different tables and columns that aren’t part of the original visual. That means you can use one parameter instead of several slicers to give users a similar experience.
SEE: Hiring kit: Microsoft Power BI developer (TechRepublic Premium)
In this tutorial, I’ll show you how to add a field parameter to a Power BI visual. We’ll compare it to a limited slicer so you can clearly see the advantages of using parameters. For this tutorial, I’m using Power BI on a Windows 10 64-bit system. The demonstration file is from AdventureWorks and can be downloaded from GitHub here.
Jump to:
Technically, a parameter is something you pass — usually a value passed to a snippet of code. It’s similar in Power BI, but you’re passing a value to a visual.
Parameters are similar to slicers and filters, allowing the end user to update a Power BI visual. However, they’re more robust, because the end user is dynamically changing the underlying columns even if they’re not part of the visual.
Before you can create a parameter, you must enable the feature. Fortunately, doing so is easy. After opening the Power BI file (.pbix), do the following:
Figure A
Power BI offers two types of parameters: Fields and Numeric Range. We’re going to create a Fields parameter that lets the end user update the visual shown in Figure B, which is based on the region and sales amounts in AdventureWorks.
Figure B
To build the visual, do the following:
Now, let’s suppose the end user wants to update this visual by product category and country. Let’s try a slicer first:
Figure C
The slicer works fine, but now it’s time to add a second one for the product category:
Both slicers work as expected, but your use case requires two. Why not use one parameter instead?
It isn’t necessary to add two slicers to the visual. A single parameter can do the job, reducing the amount of area used. In this simple example, it doesn’t seem necessary, but in a busy dashboard, you and the end user may both benefit from the streamlined operations of a parameter.
Now, let’s build a field parameter that updates by category and country:
Figure D
Power BI adds the field parameter to the Fields pane, as you can see in Figure E. You can also see the DAX code used to create the parameter. If needed, you can modify this code to update the parameter.
Figure E
With the parameter added to the Fields pane, you can now add the parameter to the visual.
Parameters are added to reports as slicers with the following steps:
Now that the parameter is in the Fields pane, you can add it to the visual as follows:
Figure F
Before we try the parameter, there are a few things you should notice. By adding the parameter to the chart, you have updated the visual a bit. In addition, Power BI has added a new legend to the visual, based on the parameter. It updates with the X-axis because that’s the bucket the parameter is in.
Using the parameter slicer is easy because you use them the same way you would use a traditional slicer. Simply click either Category or Country in the slicer. From there, you can quickly add a new dimension to the original visual.
Figure G shows the visual after you’ve checked Category. The column colors coordinate with the new legend: Bikes make the most revenue in all regions, and accessories are the items making the least.
Figure G
Figure H shows sales by country: The Southwest region brings in the most revenue. By using the legend, you can see that the region is in the United States.
Figure H
One thing we didn’t discuss is the relationships between tables. Using a parameter to combine columns from different tables is impossible if there’s no relationship to support them. This is probably in place, but if you can’t create the visual or a parameter to update it, look at the relationships. If this is a new Power BI file, it’s possible that you’ll need to create relationships between the tables in question.
SEE: Hiring Kit: Database engineer (TechRepublic Premium)
The more options the end user has to control visuals, the better. Designers can offer those opportunities by including the right type of filtering feature. Slicers are fine, but parameters are a better solution when you’re working with a busy dashboard.
Read next: Best business intelligence tools (TechRepublic)
From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays
From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays
How to create a field parameter in Power BI
Your email has been sent
TechRepublic Premium content helps you solve your toughest IT issues and jump-start your career or next project.
This is a comprehensive list of the best AI art generators. Explore the advanced technology that transforms imagination into stunning artworks.
Find the perfect payroll service for your business without breaking the bank. Discover the top cheap payroll services, features, pricing and pros and cons.
Is NordVPN worth it? How much does it cost and is it safe to use? Read our NordVPN review to learn about pricing, features, security, and more.
Free project management software provides flexibility for managing projects without paying a cent. Check out our list of the top free project management tools.
Australian and New Zealand enterprises in the public cloud are facing pressure to optimize cloud strategies due to a growth in usage and expected future demand, including for artificial intelligence use cases.
Zero-trust security operates on the fundamental premise that trust should never be assumed, regardless of whether a user or device is inside or outside the corporate network. In this TechRepublic Premium guide, we will explore the benefits of incorporating zero-trust security into your organization’s cybersecurity framework to prevent data breaches and strengthen the protection of …
Every organization relies on data that must be protected and backed up in a reliable and secure way by authorized personnel. While the content or criticality of the data may vary, the processes behind a successful backup strategy are universal. This checklist from TechRepublic Premium will help you establish a standard framework for backing up …
Artificial intelligence comes in many varieties, from tools that respond to customers via chat to complicated machine learning algorithms that predict the trajectory of an entire organization. Despite years of activity and the imaginative ideas found in science fiction, AI doesn’t yet comprise sentient machines that reason like humans. Rather, AI encompasses more narrowly focused …
Data governance is no longer a ‘nice-to-have’ measure in organizations as there is a growing concern around the globe that unregulated use of data can result in serious privacy violations, among other issues. That’s why data governance has topped the agenda in many continents as more efforts are being put in place to provide standards …
Get the web’s best business technology news, tutorials, reviews, trends, and analysis—in your inbox. Let’s start with the basics.
* – indicates required fields
Lost your password? Request a new password
Please enter your email adress. You will receive an email message with instructions on how to reset your password.
Check your email for a password reset link. If you didn’t receive an email don’t forgot to check your spam folder, otherwise contact support.
This will help us provide you with customized content.
Thanks for signing up! Keep an eye out for a confirmation email from our team. To ensure any newsletters you subscribed to hit your inbox, make sure to add [email protected] to your contacts list.

source