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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
LFR
Frequent Visitor

Grouping

Hey Experts,

TLDR: I want so sort my graph by my grouping, instead of the values.

I have a table full of different materials, with different stockrange's(time in weeks it takes, til the material stock in the warehouse is empty at current consumption rate).
Now i want to build a visual, where i show the count of materials, within a ceartain stock range (e.g. 0-4 weeks).
For that i grouped my Range column, and sorted all of the discrete columnvalues into the corresponding buckets:

LFR_0-1703785534468.png

And now i wanted to create a line and clustered column chart, where i use my grouping column as x axis, and my material count as line y axis and the material value as the column y axis.
And this works, but sadly the differentBuckets are sorted by decreasing count of materials per bucket, instead of the Buckets:

LFR_1-1703785820851.png

Does anyone knows, how im able to display the buckets and corresponding values in the correct order?

Thanks in advance. If there are additional questions to my problem, dont hesitate to ask.

Greetings LFR

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @LFR 
You need to create a table with a sorting column.
As you didn't provide a data set I will show you how it is working with mine.

1. Copy the column with the range that you created

Ritaf1983_0-1703790067905.png

2. Paste this column to Excel and remove duplicates add a sort column with the needed order

Ritaf1983_1-1703790433046.png

copy this table and paste it to PBI and load it

Ritaf1983_2-1703790515976.png

Modify the sort order of the ranges by the "sort order column"

Ritaf1983_3-1703790621268.png

create a relationship between this table to yours with the ranges :

Ritaf1983_4-1703790745657.png

Use range from the sort table in the graph:

Ritaf1983_5-1703790846795.png

More information about sorting by another column is here:

https://www.youtube.com/watch?v=CpBy79AawVw

 

pbix with my example is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @LFR 
You need to create a table with a sorting column.
As you didn't provide a data set I will show you how it is working with mine.

1. Copy the column with the range that you created

Ritaf1983_0-1703790067905.png

2. Paste this column to Excel and remove duplicates add a sort column with the needed order

Ritaf1983_1-1703790433046.png

copy this table and paste it to PBI and load it

Ritaf1983_2-1703790515976.png

Modify the sort order of the ranges by the "sort order column"

Ritaf1983_3-1703790621268.png

create a relationship between this table to yours with the ranges :

Ritaf1983_4-1703790745657.png

Use range from the sort table in the graph:

Ritaf1983_5-1703790846795.png

More information about sorting by another column is here:

https://www.youtube.com/watch?v=CpBy79AawVw

 

pbix with my example is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
LFR
Frequent Visitor

Hi @Ritaf1983 ,
thank you very much for your fast and detailed response!

I think this solution will certainly work, but I was honestly hoping for an easier way, where I can use the powerBI integrated grouping function to create both the groups and their sorting.
This way I have to create a category column from my weekly column and then combine them using the sorting mapping table just to change the order.
And unfortunately I have some similar graphics for which I have to do this...
I realy hope they will implement a custom sorting within the Grouping/Binning Menu to avoid this extra workload.

Hi @LFR 
Glad to help 🙂

According to the complicity of the sorting functionality, it is a known issue.

There is an idea about it, please vote for it (I voted 🙂 )

https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=73d72916-cf4e-4a02-bb43-bc489823c5cf&page=2

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.