The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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!!!
Solved! Go to Solution.
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.
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
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
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.