Forum Discussion
Display unfiltered values from a column when a filter is applied on another column
- 4 years ago
Hi datagnan ,
According to your description, I download your sample, here's my solution.
Create a measure.
Missing2 = VAR _T = SELECTCOLUMNS ( FILTER ( ALL ( 'my_data' ), 'my_data'[Name] = SELECTEDVALUE ( my_data[Name] ) ), "City", [City] ) RETURN CONCATENATEX ( EXCEPT ( ALL ( 'my_data'[City] ), _T ), [City], "," )Get the expected result.
I attach the sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 4 years ago
v-yanjiang-msft Thanks a bunch, yes your solution totally works for concatenating the unfiltered values.
I was looking to display them in a table, so I also figured out a solution for that as below:
Created a table with unique values for each 'City' and created a normal relationship (1 to *) with the fact table (my_data), then added 'City' to a table visual.AllNames = VALUES(my_data[City])Created 3 measures in 'my_data':
filteredCityCount = CALCULATE(COUNTROWS(DISTINCT(my_data[City])))totalCities = CALCULATE(DISTINCTCOUNT(my_data[City]),ALL(my_data))
finalFilter =IF ( [totalCities] - [filteredCityCount] = [totalCities], 1, 0)Added finalFilter = 1 as a filter to the table visual. I've updated the sample pbix file in the opening post with both solutions.
v-yanjiang-msft Thanks a bunch, yes your solution totally works for concatenating the unfiltered values.
I was looking to display them in a table, so I also figured out a solution for that as below:
Created a table with unique values for each 'City' and created a normal relationship (1 to *) with the fact table (my_data), then added 'City' to a table visual.
AllNames = VALUES(my_data[City])
Created 3 measures in 'my_data':
filteredCityCount = CALCULATE(COUNTROWS(DISTINCT(my_data[City])))
totalCities = CALCULATE(DISTINCTCOUNT(my_data[City]),ALL(my_data))
finalFilter =IF ( [totalCities] - [filteredCityCount] = [totalCities], 1, 0)
Added finalFilter = 1 as a filter to the table visual. I've updated the sample pbix file in the opening post with both solutions.