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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
kopytko95
Regular Visitor

Dynamic legend on bar chart doesn't sort categories properly when switching between selections

Okay, so i have dynamic legend with three columns/categories (one is text, two of them are numbers, 0-10 and 1-16 respectively and they have their own tables). There's parameter on the slicer, so whichever category i choose, it's on the Y axis of bar chart.
What is my problem - one of the numeric ones automatically sorts from 0 to 10 from left to right, while the other one autoamtically sorts by values.
I can manually choose to have it sorted by category, ascending instead of values, but when i do the switch on the slicer and switch back, it's again sorted by the values.
What i noticed, is that on the category that works well, when i open sorting menu (three dots -> sort axis), there is no check on neither category nor value, but on the other the check is initially always on values.

Any idea how to fix it? 

1 REPLY 1
v-heq-msft
Community Support
Community Support

Hi @kopytko95 ,
Based on your description, I can understand that you want to sort a bar chart with a fixed order of x and y axes. In Power bi, the initial sorting of the axes is usually numerical descending and alphabetical descending. If you change the data on an axis, it will be initialized. Also, you can only sort the bars according to one axis, otherwise the other axes will be affected.
You can refer to these two documents
Sort one column by another column in Power BI - Power BI | Microsoft Learn
Change how a chart is sorted in a report - Power BI | Microsoft Learn

Best regards,
Albert He

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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