Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JintePomper
Frequent Visitor

Filtering with two parameters

Hi,

 

I have a question regarding filtering a power bi template with two parameters. 

 

I have two query parameters A and B, filtering two tables 1 and 2. I used the "text filter' for this. For table 1, I use parameter A to filter department IDs, which are also used in table 2. Therefore, in table 2, I use parameter A to filter department IDs again, as well as parameter B to filter customer IDs. Then I save it as a power bi template, so when the template is opened, you can select the department ID and customer ID to filter the data.

 

However, both parameters are presented at the same time when the template is opened, and it is possible that a combination of department IDs and customer IDs gets selected that results in an empty dataset. I would like to first select a department ID, and then select from a list of customer IDs that is already filtered by the selected department ID. Does someone know if this is possible?

 

Kind regards

 

5 REPLIES 5
v-rongtiep-msft
Community Support
Community Support

Hi @JintePomper ,

I have changed my answer. Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

v-rongtiep-msft
Community Support
Community Support

Hi @JintePomper ,

I have create a simple example. The original data table is as follows. And I set parameter_depart=A /B/C and  parameter_user=1/2/3.In my table, it doesnt satisfy the two parameters.

vpollymsft_3-1643353396491.png

 

 

vpollymsft_0-1643353207716.png

 

 

I'm in this situation because my dataset does not satisfy both parameters.  There is no row in table B after filtered by parameter_depart and parameter_user.

vpollymsft_1-1643353314750.png

 

 

After I changed the data, it works well.

vpollymsft_2-1642582986279.png

 

vpollymsft_2-1643353347017.png

 

 

 

So please make sure the data satisfy the two parameters at the same time.

 

I have found a similar post, please refer to the following topic to see if it helps you.

https://community.powerbi.com/t5/Desktop/Cascading-selection-filters/m-p/260894

 

 

Or there is an document about cascading dropdowns, if it is the desired output you want.

https://forum.enterprisedna.co/t/power-bi-cascading-dropdowns/21859/2

 

If it doesn’t help, please provide your simplified pbix without privacy information and desired output.

 

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-rongtiep-msft thanks for your help. The problem is that the data and the parameters are correspondent, but there are certain combinations of parameters that result in empty tables. For example, you filled in B and 1 as parameters, but there is no combination of B with 1 in your data, which I believe would still result in an empty table in your solution. What I need is that if you get a list of parameters A/B/C and you choose one, and then you have to choose from 1/2/3, it first filters the table with the first parameter, and then only the options for the second parameter remain that you can still choose from. 

 

 

 

JintePomper
Frequent Visitor

Hi, thanks for your reply,

 

Unfortunately that doesn't work

lbendlin
Super User
Super User

Not sure if making parameter B optional would be of any help?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.