Forum Discussion
KristofferAJ
2 years agoHelper III
Powerquery 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
2 years agoSuper User
Hello 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 agoHelper 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 agoSuper User
KristofferAJ , it won't happen dynamically, you will always would adjust it as per your dataset.