Forum Discussion

uxune_24's avatar
uxune_24
New Member
2 years ago
Solved

TopN filter does not work when applying other visual filters all together

Hi Team, I hope you can help me with the following.   I have a rank (Top N) filter created.  This filter filters my visual correctly when applying alone.   However, if I try to a...
  • rajendraongole1's avatar
    2 years ago

    Hi uxune_24 -To have more control, you can try separating your Top N logic from other filters.

     

    TopN_Filter =
    IF(
    RANKX(
    ALLSELECTED('RGA: Linker'),
    [RGA % average per Clinic (Full List)],
    ,
    DESC,
    DENSE
    ) <= [Selected Top N],
    1,
    0
    )

     

    In Power BI, the RANKX function can behave differently based on the context in which it's calculated. You can try setting up a measure to calculate the rank and use ALLSELECTED as you have, but also ensure that the measure used in your Top N filter doesn't interfere with any other filters.

     

    If you're still seeing issues, you may want to debug by temporarily removing certain filters to isolate which ones are causing the ranking and filtering conflict. try it and let know and also share sample pbix file.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Thanks for the reply from rajendraongole1 , please allow me to provide another insight:

    Hi, uxune_24 

    Regarding the issue you raised, my solution is as follows:

    Firstly, I should clarify that clicking on a column in a bar chart to influence another visual object is an example of interactivity between visuals, rather than a filtering action. The area indicated in the diagram is where the filters are located.

    For further details, please refer to the accompanying information.

    Filters and highlighting in Power BI reports - Power BI | Microsoft Learn
    Add a filter to a report in Power BI - Power BI | Microsoft Learn
     

    Secondly, as I’m not entirely clear on your data structure, you might consider trying the following approaches:

    First I have created the following table and the column names and data are the data you have given:

    Using the Built-in Top N Filter:

    Here are the final results:

     

    Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

    When uploading a file, please be careful to delete sensitive information.

     

    For questions about uploading data, you can try the following links:

    How to provide sample data in the Power BI Forum - Microsoft Fabric Community

    Solved: How to upload PBI in Community - Microsoft Fabric Community

     

    Please find the attached pbix relevant to the case.

     

    Best Regards,

    Leroy Lu

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