Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
i have this problem too. do you have answer?
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.
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(),
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.
4. Sort axis – [Rank] – Sort descending.
5. Result:
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
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.
Hi,
I can´t download the file.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
63 | |
62 | |
52 | |
39 | |
24 |
User | Count |
---|---|
84 | |
57 | |
45 | |
42 | |
37 |