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
ElioAngarita
Helper I
Helper I

Getting the order i want when grouping values (buckets)

Hi Community! Thank you for your help as always.

 

My question is really simple:

Grouping PBI.JPG

 

I grouped values to have several buckets of aging ("b. 3 days" bucket include 2, 3 days - "c. 5 days" bucket includes 4,5 days, etc). The only reason i put a,b,c,d,e behind the name of the bucket is because if i didnt do that the system would organize them like this:

1 day

10 days

15 days

3 days

5 days

7 days

 

Looks like it's taking everything with number 1 first and then moving towards 2, 3 ,etc.

 

Is there any way i can bypass this?

2 ACCEPTED SOLUTIONS

Where was Bucket in your data model before you put it on a different table? You'll want to create a relationship between the new Bucket table (column Bucket) and the table where Bucket (used to) reside.  I apologize for skipping that step.

 

Also make sure that the Bucket from the new table is the one in your visual.

View solution in original post

Is Sheet1[Bucket] used in the visual?

View solution in original post

13 REPLIES 13
cadillaccc5349
New Member

This is probably an easy fix but after adding the ranking on my visualisation, the ranking label is now displayed together with the correct x-axis label. How to resolve that? 

cadillaccc5349_0-1707356606117.png

 

dedelman_clng
Community Champion
Community Champion

Create a separate table containing the bucket names and the rank, e.g.

 

Bucket     Rank

1 day       1

3 days     2

5 days     3

10 days    4

 

etc.

 

Then use the "sort by column" feature under "Column tools" to sort Bucket by Rank.

 

Replace Bucket in your visual with the Bucket from this new table and voila.

 

2020-07-30 12_40_49-Untitled - Power BI Desktop.png

 

Hope this helps,

David

 

 

Thank you for your answer! Going back to the basics (i dont wanna mess with my data) how do i create that new table? it'd be a different data sheet right?

Yes, a different data sheet or you can use "Enter Data" and put the values in manually.

@dedelman_clng i created the table on another spreadsheet, got the data in the model and got rid of the letters on my buckets.

 

Now, the sort by column option under "Modeling" is grayed out (when i have the graph selected). Is there anything im missing?

 

Thank you!

Highlight the Bucket column in the "Fields" section, then go to Column Tools -> Sort by Column.  You are changing how the sort behavior for that column works all throughout the report, not just for that visual.  You can still control the visual sorts (ascending, descending, etc) one visual at a time.

 

2020-07-30 13_10_21-Untitled - Power BI Desktop.png

@dedelman_clng back with results.

 

Did exactly what you suggested, i selected "Rank" on the Sort Column drop down menu. I also took the letters out of my grouping, but looks like im missing something else. My data wasn't sorted by the rank we input.

 

Do we need any extra step? 

 

Response.JPG

Where was Bucket in your data model before you put it on a different table? You'll want to create a relationship between the new Bucket table (column Bucket) and the table where Bucket (used to) reside.  I apologize for skipping that step.

 

Also make sure that the Bucket from the new table is the one in your visual.

@dedelman_clng

 

In one spreadsheet (data set) i have a column that calculates AGING and then another one next to it that placed that number of AGING into a category (bucket, using the IF formula). The categories are the ones stated above: 1 day, 3 days, 5 days, 7 days etc.

 

How do i connect the new table i created apart and the matrix table i created?

 

Thank you so much sir!

 

See pics below.  "Bucket" still needs to live with the fact/transactional data, so the Bucket dimension/category can be joined to it.

 

Transactional Data

2020-07-30 15_43_16-Untitled - Power BI Desktop.png

 

Buckets

2020-07-30 15_43_29-Untitled - Power BI Desktop.png

 

Model (joining "Bucket" to "Bucket"). Click on one of the "Bucket" and drag it to the other. Power BI then creates the relationship. 

2020-07-30 15_42_52-Untitled - Power BI Desktop.png

 

2020-07-30 15_46_42-Untitled - Power BI Desktop.png

Hope this helps,

David

Response.JPG

 

Thank you! i dragged and the relation was created i guess, but still the order hasn't changed. Do i need to do anything else?

Is Sheet1[Bucket] used in the visual?

IT worked! that was obvious haha.

 

Thank you so much kind sir.

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.