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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Bottom 3 values filtering zeros

I have a case in which I'm struggling a bit.

I have a fact table that reflects votes of different teams (1 row=1 Vote) and a dimension table that contains the information of each team (Name, Team member Size). Both tables are related by TeamId

 

My purpose is to calculate the 3 top teams with the highest votes average per member and the top 3 bottom teams with less average of votes per member. The top 3 are not an issue.

 

The thing is that the dimension table could contain teams that are not voting and therefore the partitipacion is 0 %. I would like to exclude those from the visual.

 

When applying a filter on participation and a Bottom 3 to teams, seems that the bottom 3 is applied first and then is filtering out the participation 0. I have more than 3 values with participation =0, so the visual is being represented as empty.

 

I would like this to happen the other way around, first filter out the participation =0, and from the rest just pick the bottom 3.

 

I guess this filtering needs to be done in a measure, but I'm not able to give with the key.

 

Thanks in advance for the help! 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please check if this is what you want:

Votes_ =
COUNT ( 'fact table'[Team] ) + 0
Bottom = 
VAR Rank_ =
    IF (
        [Votes_] > 0,
        RANKX (
            FILTER ( ALLSELECTED ( 'dimension table' ), [Votes_] > 0 ),
            CALCULATE ( [Votes_] ),
            ,
            ASC,
            DENSE
        )
    )
RETURN
    IF ( Rank_ >= 1 && Rank_ <= 3, 1 )

Icey_0-1647321291427.png

For more details, please check the attached .pbix file.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

yep, thanks

Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please check if this is what you want:

Votes_ =
COUNT ( 'fact table'[Team] ) + 0
Bottom = 
VAR Rank_ =
    IF (
        [Votes_] > 0,
        RANKX (
            FILTER ( ALLSELECTED ( 'dimension table' ), [Votes_] > 0 ),
            CALCULATE ( [Votes_] ),
            ,
            ASC,
            DENSE
        )
    )
RETURN
    IF ( Rank_ >= 1 && Rank_ <= 3, 1 )

Icey_0-1647321291427.png

For more details, please check the attached .pbix file.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , First create a measure like

 

if([participation] =0, blank(), [participation])

 

create TOP 3 on that

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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