Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

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:

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:

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

  • Hi Anonymous 
    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

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

    copy this table and paste it to PBI and load it

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

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

    Use range from the sort table in the graph:

    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

3 Replies

  • Hi Anonymous 
    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

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

    copy this table and paste it to PBI and load it

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

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

    Use range from the sort table in the graph:

    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

    • Anonymous's avatar
      Anonymous
      Not applicable

      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.