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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply

Questions about selection filter in power bi

Hello everyone, my question and a current problem is how can I select a specific customer in the graph and it correctly returns my top 5, the top 5 only works correctly when I perform the filtering through a specific filter, which in this case is typing the customer's name , but I would like if just by selecting the customer the data would adjust, for the other graphs it works properly, except for the top 5.

 

jeanbinhozouza_0-1708347215973.png

Field 1 - Manual Filter.

Field 2 - Bar chart that you would like, once selected, to properly filter the top 5.

Field 3 - Top 5.

1 ACCEPTED SOLUTION
123abc
Community Champion
Community Champion

You can use DAX measures combined with slicers or filters. Here's a general approach you can follow:

  1. Create a Measure for the Top 5 Customers: You need to create a DAX measure that calculates the relevant metric for your customers and returns the top 5 based on the selection.

  2. Use a Slicer or Filter for Customer Selection: Ensure you have a slicer or filter visual on your report page that allows users to select a specific customer.

  3. Apply the Measure to Your Visual: Apply the DAX measure you created in step 1 to the visual that displays the top 5 customers. This visual could be a table or a bar chart, depending on your preference.

Here's a sample DAX measure that calculates the metric (let's call it "Metric") and returns the top 5 customers based on the selected customer:

 

Top 5 Customers =
VAR SelectedCustomer = SELECTEDVALUE('Customer'[CustomerName])
RETURN
TOPN(5,
FILTER(ALL('Customer'),
'Customer'[CustomerName] = SelectedCustomer
),
[Metric], DESC
)

 

Replace 'Customer'[CustomerName] with the actual column reference to your customer names, and [Metric] with the actual metric you're measuring (e.g., sales, revenue, etc.).

Once you have the measure in place, you can apply it to your visual representing the top 5 customers. When a specific customer is selected in the slicer or filter, the top 5 customers visual should adjust accordingly based on the selected customer.

If you encounter any issues or need further assistance with implementing this in Power BI, feel free to provide more details, and I can assist you further.

 

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

 

In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.

View solution in original post

1 REPLY 1
123abc
Community Champion
Community Champion

You can use DAX measures combined with slicers or filters. Here's a general approach you can follow:

  1. Create a Measure for the Top 5 Customers: You need to create a DAX measure that calculates the relevant metric for your customers and returns the top 5 based on the selection.

  2. Use a Slicer or Filter for Customer Selection: Ensure you have a slicer or filter visual on your report page that allows users to select a specific customer.

  3. Apply the Measure to Your Visual: Apply the DAX measure you created in step 1 to the visual that displays the top 5 customers. This visual could be a table or a bar chart, depending on your preference.

Here's a sample DAX measure that calculates the metric (let's call it "Metric") and returns the top 5 customers based on the selected customer:

 

Top 5 Customers =
VAR SelectedCustomer = SELECTEDVALUE('Customer'[CustomerName])
RETURN
TOPN(5,
FILTER(ALL('Customer'),
'Customer'[CustomerName] = SelectedCustomer
),
[Metric], DESC
)

 

Replace 'Customer'[CustomerName] with the actual column reference to your customer names, and [Metric] with the actual metric you're measuring (e.g., sales, revenue, etc.).

Once you have the measure in place, you can apply it to your visual representing the top 5 customers. When a specific customer is selected in the slicer or filter, the top 5 customers visual should adjust accordingly based on the selected customer.

If you encounter any issues or need further assistance with implementing this in Power BI, feel free to provide more details, and I can assist you further.

 

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

 

In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.