Adding multiple parameters to a DAX query as a filter in Power BI Report Builder

We may want to use multiple parameters as a filter in the DAX query while working in report builder, however, we usually do not receive the intended result.

In most cases, the filter we use in a DAX query with a parameter looks like this.

Using a parameter as a filter in a Dax query

We will not get the expected report if we try to choose multiple parameters and run the report. Instead, we were given an empty table with no rows. Even if we use the in operator instead of the = operator, we will not get the desired result.

The result when multiple parameters are selected

This problem can be fixed by following the simple steps below.

Step1 : Modify the DAX filter query by adding pathcontains function as shown below.

Dax filter query with path contains a function

Step2 : Select the dataset to which the multiple parameters will be applied as a filter. Go to dataset properties by right-clicking. Then you can select parameters. The parameter value will be as follows at first.

The Dataset Properties dialogue box

Step3 : Now update the value of the parameter as shown in the expression below. Using the | symbol, we’re attempting to split multiple parameters. To continue, click OK.

Using the | symbol to split multiple parameters

Step4 : Run the report after selecting the required values in the multi-value parameter.

The result after the changes have been made

With the values from the multi-value parameter, we can now get the expected output.

The PATHCONTAINS DAX function is used to get the preferred outcome. This DAX function checks if the provided items are present within the defined route. If the supplied object is found within the defined path, it returns TRUE. This function belongs to the Parent and Child function category.

Source: https://medium.com/bi3-technologies/adding-multiple-parameter-to-a-dax-query-as-a-filter-in-power-bi-report-builder-6eb3dd5055c

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Shahnewaz Khan

10 years of experience with BI and Analytics delivery.

Shahnewaz is a technically minded and accomplished Data management and technology leader with over 19 years’ experience in Data and Analytics.

Including;

  • Data Science
  • Strategic transformation
  • Delivery management
  • Data strategy
  • Artificial intelligence
  • Machine learning
  • Big data
  • Cloud transformation
  • Data governance. 


Highly skilled in developing and executing effective data strategies, conducting operational analysis, revamping technical systems, maintaining smooth workflow, operating model design and introducing change to organisational programmes. A proven leader with remarkable efficiency in building and leading cross-functional, cross-region teams & implementing training programmes for performance optimisation. 


Thiru Ps

Solution/ Data/ Technical / Cloud Architect

Thiru has 15+ years experience in the business intelligence community and has worked in a number of roles and environments that have positioned him to confidently speak about advancements in corporate strategy, analytics, data warehousing, and master data management. Thiru loves taking a leadership role in technology architecture always seeking to design solutions that meet operational requirements, leveraging existing operations, and innovating data integration and extraction solutions.

Thiru’s experience covers;

  • Database integration architecture
  • Big data
  • Hadoop
  • Software solutions
  • Data analysis, analytics, and quality. 
  • Global markets

 

In addition, Thiru is particularly equipped to handle global market shifts and technology advancements that often limit or paralyse corporations having worked in the US, Australia and India.