Forum Discussion
Build dynamic TopN Filter on page with fieldparameter
Hi everyone,
I am trying to build a dynamic TopN filter with field parameters. I cannot use field parameters in the filter bar under TopN filtering, so I would like to put it on the page and use it to dynamically move the TopN number.
I have a D_Article and an F_Sales.
With the field parameter, I can switch between F_Sales[Quantity] and F_Sales[Revenue]. Now I would also like to have the option of controlling the number of bars in the visual with a TopN filter on the page.
Does anyone have any ideas?
Hi showy123
There must be different ways to solve this, but here is my solution:
-
Create a numeric parameter (
TopN). -
Create two measures (
TopN Filter Chart1andTopN Filter Chart2) — one for each chart — that return 1 if the column falls into topN. Use these measures as visual-level filters to show only 1.
I have attached a sample file with the measures I created for your reference.
-
6 Replies
- kushanNa
Super User
Hi showy123
There must be different ways to solve this, but here is my solution:
-
Create a numeric parameter (
TopN). -
Create two measures (
TopN Filter Chart1andTopN Filter Chart2) — one for each chart — that return 1 if the column falls into topN. Use these measures as visual-level filters to show only 1.
I have attached a sample file with the measures I created for your reference.
- showy123Frequent Visitor
Hi
works perfect, thank you a lot
-
- ajaybabuinturi
Super User
Hi showy123,
You can use below article to fulfill your requirement and also you can find sample .pbix file in that.
https://community.fabric.microsoft.com/t5/Power-BI-Community-Blog/Creating-an-interactive-Dynamic-TOPN-Selection-in-Power-BI-for/ba-p/4659410Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.- showy123Frequent Visitor
Hi Thanks for your reply,
what is the best way to share the ..pbix? I tried to drag and drop it inside here but .pbix is not supported.- ajaybabuinturi
Super User
hi showy123,
You can keep your sample file in any of cloud platform and share that url by using insert/edit link.