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
Alirezam
Helper V
Helper V

Sorting a bar chart

I am trying to sort a bar chart on its legend (Yellow to be on the left to Red on the right). When I choose "sort by column" it sorts the legend alphabeticalley as appeared below that I don't want.

Also, If I use the ascending/descending option from the top right corner of the chart, the months order craps !

Thank you for your time.

Capture.PNG

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Create a 2 column Table with Meter types in column A and numbers denoting desired sort order of meter type in column B.  So against Mental health, there should be 1 and agsinst Manua Rd. should be a 4.  Create a relationship from the Meter Type column of your Table to the Meter Type column of this new Table.  In your Data Table. write this calculated column formula to bring over the order from the new Table

Order = RELATED('Meter Type'[Order])

In your Table, click on any cell in the Meter Type column and go to Sort By Column > Order.

To your visual, drag Meter Type from your Table.

Does this work?  If not, then share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

Create a 2 column Table with Meter types in column A and numbers denoting desired sort order of meter type in column B.  So against Mental health, there should be 1 and agsinst Manua Rd. should be a 4.  Create a relationship from the Meter Type column of your Table to the Meter Type column of this new Table.  In your Data Table. write this calculated column formula to bring over the order from the new Table

Order = RELATED('Meter Type'[Order])

In your Table, click on any cell in the Meter Type column and go to Sort By Column > Order.

To your visual, drag Meter Type from your Table.

Does this work?  If not, then share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.