Forum Discussion
Dynamic Parameter with values based on selected value through the slicers
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:
Created disconnected table of distinct product for to use in slicer field, see image:
No relationship between the table.
Placed the product from Distinct Product table in slicer. See image:
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:
When selected Product 1:
When selected Product 2:
Hope this helps!!
If this solved your problem, please accept it as a solution and a kudos!!
Best Regards,
Shahariar Hafiz