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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Bar chart ...

Our requirement is pretty simple and I am not sure how to achieve this in Power BI. We need to display a measure in the form of a bar graph with a producing facility on the X-Axis. We want to show the bar graphs in a particular order of producing facility and NOT sorted by the displayed measure. I am unable to achieve this in Power BI. I have 2 tables, one fact table and another dimensional table that contains producing facilities which includes a sort order (numeric value). I add the sort order, producing facility as my X-axis. The graph displays fine in order, however, the producing facility does NOT show up on my X-axis, only the sort order. How can I display the Producing Facility on my X-axis?

 

TIA

6 REPLIES 6
MrKrukauskas
Helper I
Helper I

Hi jagannathan, 

 

Instead of Sort Order in the X Axis, put Producing Facility there. Then, in the visual, select Sort By Producing Facility.

It will sort according to your predefiend sort order. It worked for me:

 

MrKrukauskas_1-1593221468146.png

MrKrukauskas_2-1593221522915.png

 

Let me know if it works.

 

Anonymous
Not applicable

It doesn't work. For instance, here's a summary of my data as an example

Producing Facility#OfUnits
ABC1
ZYZ20
EFG5
XYZ9

 

Dimensional table for Sort Order

Producing FacilitySort Order
XYZ1
ABC2
ZYZ3
EFG4

 

Bar graph should display #OfUnits in the "Sort Order"

I think it worked if the picture below is how you wich to see the results.

After creating the visual, go to the table to the right, select the Producing facility column, then in the ribbon, select column tools, Sort by and select Sort order column.

 

MrKrukauskas_0-1593227658710.png

 

Hope it works! 

Anonymous
Not applicable

Hi MrKrikausk - That helps. However, since I am using SQL Server views and NOT tables, the column sort options don't show up. I guess that is the problem. I will have to convert the views into Tables and give it a try

 

 

jagannathan_4-1593274486259.png

 


 

 

Hi @Anonymous ,

 

Are you connecting to SSAS?

You have to sort this in SSAS model itself as live connection  does not have the ability to perform sorting.

 

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

@Anonymous , I am sure that you have done two-steps.

1. Mark sort column. Sort Order is Sort column of Facility

2. From three dots you have chosen facility as the sort column

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.