Home > Mobile >  Turning metric values into buckets in Power bi
Turning metric values into buckets in Power bi

Time:07-01

I have two columns of data like this: enter image description here

Now I want to turn tenure into buckets like this: enter image description here

I've searched but none of those works in Power bi. What should I do?

CodePudding user response:

There is a very simple way to create groups and buckets. Simply right-click the field you want to group in the right bar and select "New group".

However, I find it quite finicky to use with fixed sized bins.

My preferred way it to simply create a new calculated column, using the SWITCH dax function:

tenure_group = 
VAR Val = Table[tenure]
RETURN
SWITCH(
    TRUE(),
    Val <= 5,
    "0-5 months",
    Val > 5 || Val <= 45,
    "6-45 months",
    Val > 45 || <= 69, 
    "46-69 months",
    "70  months"
)
  • Related