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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors