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
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
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.