Harsh Naidu
Harsh Naidu

Reputation: 1

Filter Chart based on selected Date in Power BI

I need to show "TOP 10" Postal Areas based on Sales for the selected date in Power BI.

I've used "Clustered column chart" and have also sorted the data based on Sales but the problem is it shows all the data sorted in descending order which is useless. I want to show only the first 10 bars (for TOP 10 Areas) and not all.

Thanks in advance.

Upvotes: 0

Views: 289

Answers (2)

Yashodeep Faye
Yashodeep Faye

Reputation: 11

You could also do this by using the filter pane if you are not comfortable with DAX. (You can add the data filter for the visual/page/report level.)

Considering the fields in the graph are - Date, Sales, Postal Areas.

Select the Postal areas data field in the filter pane, in that select filter type by TopN, and enter the top as 10 and in the By Value insert the Sales column, apply.

Upvotes: 0

Laurentiu Diaconu
Laurentiu Diaconu

Reputation: 124

So, as far as I understand, you have a separate table for the areas (postal areas).

In order to show only the top 10 areas by Sales, you need to create a new measure on the areas (postal areas) table and use the RANKX function (let's call the measure "Rank").

RANKX should operate on your table of postal areas, it should consider the Sales expression (I guess you have a Sales measure), and it should set the order to descending.

After that, you have to include the Rank measure as a visual filter in your column chart, and set to it to be "less than or equal to 10".

Let me know what you've achieved. :)

Upvotes: 1

Related Questions