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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
uxune_24
New Member

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. 

uxune_24_0-1730734265366.png

This filter filters my visual correctly when applying alone.

uxune_24_1-1730734679317.pnguxune_24_2-1730734693903.png

 

However, if I try to apply another visual filter (having it filtered by Top N another than 5, i.e. 10, 30, 40), there is data lost. For example, I'm applying dates (filter by month: April) filter while Top N is 40 (if selected Top N 10 is the same):

 

 April selected

uxune_24_3-1730734836627.png

See result:

uxune_24_4-1730734867362.png

There is missing data at the end. Also, the visual itself is not being ranked.

 

Can anyone help me with this? I don't know where the issue is and how to fix it..

 

Thank you!

 

Extra info

Measure to show by default Top N 10

uxune_24_5-1730734983439.png

Another Measure

uxune_24_6-1730735086196.pnguxune_24_7-1730735139321.png

uxune_24_8-1730735160467.png

uxune_24_9-1730735181302.png

 

 

 

 

 

 

 

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

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.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

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.

vlinyulumsft_0-1730886558812.png

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:

vlinyulumsft_1-1730886606684.png

Using the Built-in Top N Filter:

vlinyulumsft_2-1730886606685.png

Here are the final results:

vlinyulumsft_5-1730886644794.png

 

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.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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.

vlinyulumsft_0-1730886558812.png

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:

vlinyulumsft_1-1730886606684.png

Using the Built-in Top N Filter:

vlinyulumsft_2-1730886606685.png

Here are the final results:

vlinyulumsft_5-1730886644794.png

 

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.

rajendraongole1
Super User
Super User

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.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.