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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
anmoltripathi5
Frequent Visitor

Dynamic Parameter with values based on selected value through the slicers

Please help me with the below problem.

 

I have products in my data like product1, product2, product3 and so on.

These products have presence in different countries. For example product1 is present in USA, India, china whereas product2 is present in Russia, India and USA.

I created a dashboard where I have a slicer(single select) of the product by which I can select any single product at a time. 

I want to create a dynamic parameter in which I get the list of all distinct countries except the countries present in selected product through the slicer.

For example when I select product 2 then parameter should contain all districts countries except Russia India and USA.

If I select product 1 that parameter should change dynamically and should contain all countries except USA, India, china.

Thanks in advance 

@Anonymous , @Anonymous 

2 REPLIES 2
shafiz_p
Super User
Super User

Hi @anmoltripathi5 ,
It is better to provide representative data and expected output t get exact soluion.

However, as I understand that you want a solution to list distinct countries which are not in the selected product. If this is the case then you need a disconnected table of distinct product which will be used in slicer.

See example date based on your discription. Data source image:

shafiz_p_0-1732444830475.png

 

Created disconnected table of distinct product for to use in slicer field, see image:

shafiz_p_1-1732444889729.png

No relationship between the table.

 

Placed the product from Distinct Product table in slicer. See image:

shafiz_p_2-1732444960532.png

 

 

Now create a measure to list all the distinct country separated by comma which are not the country of selected product.

 

Try this code to create measure:

DistinctCountriesNotInSelectedProduct = 
VAR SelectedProduct = SELECTEDVALUE('Distinct Product'[Product])
VAR AllCountries = DISTINCT('DataSource'[Country])
VAR CountriesInSelectedProduct = CALCULATETABLE(
    DISTINCT('DataSource'[Country]),
    'DataSource'[Product] = SelectedProduct
)
RETURN
CONCATENATEX(
    EXCEPT(AllCountries, CountriesInSelectedProduct),
    [Country],
    ", "
)

 

Place this in card and you are done. See output image:
When no selection is made:

shafiz_p_3-1732445168115.png

When selected Product 1:

shafiz_p_4-1732445210565.png

When selected Product 2:

shafiz_p_5-1732445245051.png

 

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

Best Regards,
Shahariar Hafiz

danextian
Super User
Super User

Hi @anmoltripathi5 

 

If by a dynamic parameter you mean to create a list of countries that are not present in selected products' countries, the you need to duplicate your product table and use a measure to filter the visible countries in a table visual.

 

danextian_0-1732440541738.png

danextian_1-1732440558060.png

If you're referring to the field parameter, the fields you added to it are what you get and won't change based on  slicer selection. The field parameter feature creates a calculated table and calculated tables are updated only if the underlying data has been refreshed or the formula has been in any way modified. Please see attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.