Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi Friends,
I am looking for a suggestion on adding sort in Stacked bar charts on Legends. Please suggest how this can be achieved. I don't see any option which sorts my data using legends. Attached the sample data on which i tried and also picture how it looks
my expectation is - chart should be sorted with Type 1 and it's share by desc
Prod 6
Prod 3
prod 8
Prod 4
Prod 1
prod 2
sample :
Prod | Actual | Type |
prod1 | 1757.00 | Type1 |
prod1 | 2202.00 | Type2 |
Prod2 | 244.00 | Type1 |
Prod2 | 328.00 | Type2 |
Prod3 | 2145.00 | Type1 |
Prod3 | 458.00 | Type2 |
Prod4 | 164.00 | Type1 |
Prod4 | 159.00 | Type2 |
Prod5 | 206.00 | Type1 |
Prod5 | 1047.00 | Type2 |
Prod6 | 3010.00 | Type1 |
Prod6 | 133.00 | Type2 |
Prod7 | 931.00 | Type2 |
Prod8 | 877.00 | Type1 |
Prod8 | 592.00 | Type2 |
Thank you for the mention @lbendlin . PBI file attached. Solved it with measures and is therefore dynamic.
Hope this helps.
Thanks @Ashish_Mathur , I will go through the measures and try to replicate in my application.
In the regular world a column can only be sorted by itself or by another column, not by a measure. ( @Ashish_Mathur may know a trick using visual type switching )
Even a DAX column will result in a circular reference, so you would need to create that sort column in Power Query.
This of course no longer makes it dynamic. But it produces the desired result.
@Ashish_Mathur , could you provide some suggestions here how can we do in visualization or any other methods
I have already shared my solution.
Thanks @lbendlin for your reply. I will try it on my data set. I am just wondering about performance of this query on data when we have large data. Data which i had provided is aggregated and sample.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
14 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
10 | |
3 | |
3 | |
3 | |
2 |