cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## How to sort a bar chart depending on slicer selection

Hello everyone,

How can i sort a bar chart depending on slicer selection?

I mean if i select in slicer "Sum of IDADE" i want the sort descending from the values, and if i select in slicer "Sum of ALTURA" i want the sort descending. Or if i Select All just let the sort descending from Sum of ALTURA values.

Is this possible?

Thanks.

5 REPLIES 5
Regular Visitor

i have this problem too. do you have answer?

Community Support

Hi  @Anonymous ,

I'm sorry, please click this, it's ok now.

How to sort a bar chart depending on slicer selection.pbix

Best Regards,

Liu Yang

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

Community Support

Hi  @Anonymous ,

I created some data:

Here are the steps you can follow：

1. Use Enter data to create a table as a slicer.

2. Create measure.

``````Flag =
SWITCH(
TRUE(),
CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Group]="ALTURA"&&'Table'[CA]=MAX('Table'[CA]))))``````
``````rank =
RANKX(ALL('Table'),[Flag],,DESC)``````

3. Put [Rank] on the Tooltips of the bar graph.

4. Sort axis – [Rank] – Sort descending.

5. Result:

Best Regards,

Liu Yang

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

Anonymous
Not applicable

That's not what i pretend.

I want the sort descending from the values, and if i select in slicer "Sum of ALTURA" i want the sort descending depending on that value. Or if i Select All just let the sort descending from Sum of ALTURA values.

Anonymous
Not applicable

Hi,

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors