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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
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?

 

xumbinho_0-1652865572209.png

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
juhui
Regular Visitor

i have this problem too. do you have answer?

v-yangliu-msft
Community Support
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.

v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1653274590886.png

Here are the steps you can follow:

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

vyangliumsft_1-1653274590889.png

2. Create measure.

Flag =
SWITCH(
   TRUE(),
    MAX('Slicer'[ALTURA.IDADE])="Sum of IDADE",CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[CA]=MAX('Table'[CA]))),
    MAX('Slicer'[ALTURA.IDADE])="Sum of ALTURA",CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[CA]=MAX('Table'[CA]))),
    MAX('Slicer'[ALTURA.IDADE])="ALL",
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.

vyangliumsft_2-1653274590895.png

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

vyangliumsft_3-1653274590897.png

5. Result:

vyangliumsft_4-1653274590898.png

If you need pbix, please click here.

 

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, 

I can´t download the file.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.