Forum Discussion
Remove elements from View that is selected in the Slicer
- 5 years ago
Hi, Anonymous ;
In my case , we could change the measure as follows:
Inverse Selector = IF(NOT(ISFILTERED(Slicer[Country])),1,IF(MAX([Country]) IN DISTINCT('Slicer'[Country]),0,1))The final output is shown below:
In your case, you could try :
Inverse Selector = VAR __CurrentCountry = MAX ( Merged_VOL_OMD[OMD.MAIN COUNTRY(ENG/BILLING/VENDORS/FINANCIALS)] ) VAR __Countries = DISTINCT ( RemoveCountries[Country] ) RETURN IF ( NOT ( ISFILTERED ( Slicer[Country] ) ),1, IF ( __CurrentCountry IN __Countries, BLANK (), 1 ))Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous So like this? Inverse Selector - Microsoft Power BI Community
- Anonymous5 years agoNot applicable
Yes Greg_Deckler , exactly like that. When "AB" is selected, it shows everything other than "AB".
I think I should implement:
1. Store the unique countries OR the list that is shown in the Slicer as a Measure
Countries = DISTINCT(TableNm[Country]) // Replication for your Products2:
Inverse Selector = VAR __dept = MAX([Department]) // What should be HERE ?? VAR __countries = VALUES(Countries[Country]) VAR __table = SELECTCOLUMNS(FILTER(ALL('TableNm'),[Country] IN __Countries),"__dept",[Department]) RETURN IF(__dept IN __table,BLANK(),1)I can't get the following:
1. MAX of a table - what does that produce ? I can't find it in the docs - DAX - MAX, MAXA & MAXX Functions with an example - Power BI Docs
2. So this would return a seperate dataset/table named "Inverse Selector" ?
3. I would need "Real Volume (MB)" column that is shown as Values in the chart & "PMN" column as I show the Count of PMN in tooltip.
4. Importantly, I don't get how we will have the countries that are selected in the Slicer
It would be great if you can help me with this and understand it.
Thank You
- Greg_Deckler5 years ago
Community Champion
Anonymous I'd have to download the PBIX with that quick measure to remember, I think I was using a disconnected table for product? So, in your case, you are going to always be referring to country but depends on the table. That actually simplifies things. Let's say you have your original table TableNm and your Countries table.
Inverse Selector = VAR __CurrentCountry = MAX('TableNm'[Country]) //get the current country in context VAR __Countries = DISTINCT('Countries'[Country]) //get the countries selected in slicer RETURN IF(__CurrentCountry IN __Countries, BLANK(), 1)Now, this returns a measure that is either BLANK if the country is selected in the slicer or 1 if it is not. So, you filter your visual to this meausre = 1
- Anonymous5 years agoNot applicable
Hello Greg_Deckler ,
I don't get the expected result; result is I either show all data or no data. I am sharing my tables and contents for better understanding:
Main Table Supporting Table
OMD.Main Country - as the Country & Real Volume as the Volume used in the visuals.
RemoveCountries - has all Distinct values of OMD.Main Country
Filters on my visuals:
Country, Partners, & Volume filters are locked - so they shouldn't have any impact on this visual. Only active filter is "Inverse Selector".
Slicer is :
To check, I created a measure "CountryChanged" that shows the selected country:
CountryChanged = SELECTEDVALUE(RemoveCountries[Country], 0)However, I want MULTIPLE countries to be selected, so this won't work. It was just a test.Inverse Selector:
Inverse Selector = VAR __CurrentCountry = MAX(Merged_URC_OMD[OMD.MAIN COUNTRY(ENG/BILLING/VENDORS/FINANCIALS)]) // Get the current country in context VAR __Countries = DISTINCT(RemoveCountries[Country]) // Get countries selected in slicer RETURN IF(__CurrentCountry IN __Countries, BLANK(), 1)If nothing is selected in the slicer, I see blank chart:
To remove "Mexico", I select Mexico from the Slicer:
We see all the data including Mexico (the 1st country)
Can't get the error. Can you look and help me.
Thank You