Forum Discussion
KristofferAJ
Helper III
2 years agoPowerquery devide a columns into three equal sized groups/bins
Hi, I have have a column with countries and next to them a RANK (whole number 1-65, depends on the dataset) - I would like a measure which places each country into a group or a tier. For instanc...
Idrissshatila
Super User
2 years agoHello KristofferAJ ,
you can add a calculated column as the following
grouping =
IF (
'YourTableName'[Rank] >= 1
&& 'YourTableName'[Rank] <= 5,
"Group A",
IF (
'YourTableName'[Rank] >= 5
&& 'YourTableName'[Rank] <= 8,
"Group B",
IF ( 'YourTableName'[Rank] >= 9 && 'YourTableName'[Rank] <= 12, "Group C" )
)
)
- KristofferAJ2 years ago
Helper III
Thanks - but it wont work if my next dataset will have 40 countries... thus I need the calculation to look at the entire grou, like an ARRAY in excel
- Idrissshatila2 years ago
Super User
KristofferAJ , it won't happen dynamically, you will always would adjust it as per your dataset.