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
avawhittington
Frequent Visitor

Exclude Data with conditions using a slicer

I want to make a slicer from a measure that exclude a partner name... lets call it "uniquename" when it is selected. And when it is not selected I want to just show all of the partners plus "uniquename"

 

Edit: I have found this https://community.powerbi.com/t5/Desktop/Include-Exclude-Slicer/m-p/1925559 and it is similar to what I want to do... I got the below dax to work. But it is still not 100% what I want. I want my slicer to only have one option "Exclude UniqueName" and when it is selected it excludes it from consideration from all the visuals. When the slicer is cleared/ unselected I want to see all the partners (including UniqueName)....... Right now, the dax below... when I clear/ unselect both options. I don't see any data Credit: @Icey 

 

Excluding UniqueName =
SWITCH (
    SELECTEDVALUE ( 'ExcludeTable'[Value]),
    "With UniqueName", COUNTROWS ( Partner ),
    "Without UniqueName",
        CALCULATE (
            COUNTROWS ( partner ),
            FILTER (
                ALLSELECTED ( partner ),
                Partner[PartnerName] = MAX ( Partner[PartnerName] ) && Partner[PartnerName] <> "UniqueName"
            )
        )
)
4 REPLIES 4
djurecicK2
Super User
Super User

Ok. Is the slicer multi or single select? Also, what happens if "uniquename" is selected? Not sure if it is possibly to do what you are asking, but will try to look into it or maybe someone else has an answer.

I believe I want it single select (if possible) , so the slicer has only one option "Exclude Partner UniqueName". When this is not selected I want to see all of my partners including UniqueName. I am super new to PowerBi so this would help a lot. 

 

I have been looking at this solution because it is similar to what I want.  https://community.powerbi.com/t5/Desktop/Include-Exclude-Slicer/m-p/1925559

djurecicK2
Super User
Super User

Hi @avawhittington ,

 Not totally sure what you are trying to do. Can you just use a filter on the slicer to exclude a name?

I am trying to have it toggle. If I just use a slicer and put [PartnerName] and I click one partner name it will just show that one and not the rest... unless I manually click all the ones I want ( but I have too many to do that) . I have a partner named " uniquename" (for this example) and I want to show it when the slicer is unselected... as well as all the other partners and their names. When the slicer is selected I want to show all the partners and their names WITHOUT the partner "uniquename" 

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.