Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I would like to create a bar chart with these columns: Category, Subcategory, Quantity
The x axis will be both Category and Subcategory.
The y axis will be Quantity.
I want to sort Category and Subcategory by descending order of Quantity. What this means is Category bars will be from tallest bar to shortest. Then, after drilling down, the Subcategories belonging to each Category will also be sorted from tallest bar to shortest bar.
I've tried:
1. Transform Data > Group by Category with Sum of Quantity as aggregation > Sort > Add Index > Sort Category column with Index
- this doesn't work because I have other columns in the same table which I'm using as Slicer.
2. The same thing as #1 but on Subcategory
- doesn't work as well. Same reason as #1
3. Add Category, Subcategory and Quantity in a Table visual > Shift click on Category and Quantity > Change Table visual to Bar chart
- this doesn't work because although the Subcategories will sort in descending order of Quantity within their respective Category, the Category is not sorted by Quantity but by alphabetical order.
4. The same thing as #3 but shift click on all three columns
- doesn't work because it results in the default sort of the existing data.
I've ran out of ideas. Please help! 😞
Edit: I found the solution on YouTube! Link: https://youtu.be/RDXvpE3V5m0?si=NA5s7BVR5Xu9yy6g
Solved! Go to Solution.
I found the solution on YouTube! Link: https://youtu.be/RDXvpE3V5m0?si=NA5s7BVR5Xu9yy6g
I found the solution on YouTube! Link: https://youtu.be/RDXvpE3V5m0?si=NA5s7BVR5Xu9yy6g
@Anonymous Hey,
Kindly use cluster column chart for your requirmeent.
Please refer below example for your reference.
I am following below steps.
select Cluster column chart
drag your cat and sub cat to x axis
drag your QTY measure to value.
select three dot on right side - select sort by QTY then select ASC order to sort as per your requirment.
Thanks
Harish M
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Add snapshop for your reference
Hi @HarishKM
Hi again,
Here is an advanced version of this approach which should work in more complicated scenarios.
The idea is to create a measure which generates a sorting order value consisting of two parts: the whole part is responsible for sorting categories, the decimal part - for sorting subcategories.
Best Regards,
Alexander
Hi! Sorry for the incredibly late reply. It doesn't quite work somehow. But good news, i found a video online that solves my problem. Thank you so much for your time !!
Hi @Anonymous,
I can offer you to create a sorting option like this one:
With your real data it can be more complicated.
Once done, you can add it to Tooltips, then it will be available among the sorting options.
If you drill down, you will get what you want with subcategories:
Best Regards,
Alexander
Hi @barritown
Thanks for this. However, as you've expected, my data is a bit more complicated, hence I'm unable to get the expected result. Thank you very much for your work book as reference too.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 63 | |
| 31 | |
| 30 | |
| 23 |