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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sweidlich
Advocate II
Advocate II

Legend affecting how filter is behaving

I feel like this should be easy, but Powerbi is not behaving how I am expecting.

 

I have 3 columns of data:

1) UniqueID

2) Location

3) Presence/Absence of Trait (in "yes" or "no").

 

But some locations only have 1-9 instances, and I'm interested in only those locations with 10 or more.

 

When I make a table:

Location is rows; trait is column, and "count of uniqueid" is the value.

And then, because there are a bunch of locations and I only want the most active ones, I find the "visual level filter" and limit the "count of UniqueID" to only count those "greater than or equal to 10." So far so good. This limits my location list to just those top locations.

 

However, when I make that same data into a stacked 100% bar chart, the "visual level filter" doesn't filter the total number of uniqueIDs anymore. It seems to be filtering each trait in the "legend" box separately.

 

So, for example, if I have a location with 15 UniqueIDs, with 10 "traitYes" and 5 "traitNo", this shows up fine in my table. But in the bar chart, it is filtering out the 5 "traitNo"s because there are less than 10. So instead of that location demonstrating 66% traitYes (as in the table), it's demonstrating 100% traitYes.

 

How can I limit my bar chart to those locations with 10 or more uniqueIDs in TOTAL, not just those locations with 10 or more uniqueIDs in TraitYes AND TraitNo?

1 ACCEPTED SOLUTION
d_gosbell
Super User
Super User

From your description it sounds like you want to ignore the Presence/Absence column when doing the distinct count. You could do this with an expression like the following:

 

CALCULATE( DISTINCTCOUNT( Table1[UniqueID] ) , ALL( Table1[Presence/Absence of Trait (in "yes" or "no")] ) )

View solution in original post

1 REPLY 1
d_gosbell
Super User
Super User

From your description it sounds like you want to ignore the Presence/Absence column when doing the distinct count. You could do this with an expression like the following:

 

CALCULATE( DISTINCTCOUNT( Table1[UniqueID] ) , ALL( Table1[Presence/Absence of Trait (in "yes" or "no")] ) )

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.