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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
DataLake00
New Member

Bins and Ranking in Power Query

Hello everyone,

 

I have a table in this moment of 235 rows that is going to be expanded since it is a repository of projects. I would like to create with Power Query 10 bins and assign to the first bin the ranking value 10, to the second one 9, to the third one 8 and so on until the last one with 0.

Can someone help me in achieving this goal?

 

Many thanks in advance!!!

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @DataLake00 ,

To create bins in Power Query, you can follow these steps:
Load your data into Power Query Editor.
Right-click the field (column) you want to bin, then choose New group.
In the Groups dialog box, set the Bin size according to your preference to create 10 bins.
Click OK. A new field appears in the Fields pane with (bins) appended.

Assigning ranking values to bins in descending order can be achieved through a custom column:
With your binned data in Power Query, go to the Add Column tab and select Custom Column.
In the formula area, you can use a simple M code to assign rankings based on the bin. For example, if your bins are in a column named 'Bin', your formula might look something like 10 - [Bin]. This assumes your bins are numbered 0 to 9.
Click OK to add the column with rankings.

I found the following document for you that might be helpful:
Group Bin in Power Query - Microsoft Fabric Community
Create Customized Age Bins (or Groups) in Power BI - RADACAD
www.popautomation.com

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

View solution in original post

collinsg
Solution Sage
Solution Sage

Good day DataLake00

While it is possible to bin in Power Query, the natural place to bin is in the report view as described here. What happens, in effect, is that a calculated column is added to the table. You can choose the number of bins or the size of bins.

Hope this helps

View solution in original post

2 REPLIES 2
collinsg
Solution Sage
Solution Sage

Good day DataLake00

While it is possible to bin in Power Query, the natural place to bin is in the report view as described here. What happens, in effect, is that a calculated column is added to the table. You can choose the number of bins or the size of bins.

Hope this helps

Anonymous
Not applicable

Hi @DataLake00 ,

To create bins in Power Query, you can follow these steps:
Load your data into Power Query Editor.
Right-click the field (column) you want to bin, then choose New group.
In the Groups dialog box, set the Bin size according to your preference to create 10 bins.
Click OK. A new field appears in the Fields pane with (bins) appended.

Assigning ranking values to bins in descending order can be achieved through a custom column:
With your binned data in Power Query, go to the Add Column tab and select Custom Column.
In the formula area, you can use a simple M code to assign rankings based on the bin. For example, if your bins are in a column named 'Bin', your formula might look something like 10 - [Bin]. This assumes your bins are numbered 0 to 9.
Click OK to add the column with rankings.

I found the following document for you that might be helpful:
Group Bin in Power Query - Microsoft Fabric Community
Create Customized Age Bins (or Groups) in Power BI - RADACAD
www.popautomation.com

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

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.