Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Percentage Group/Buckets?

Hello everyone! I have data that looks like below (1st picture). I created a random table in Power BI as a visual with calculations which show the amount of tasks a person has done (2nd picture). The amount of Tasks done is calculated based on the COUNT(Tasks), and the Progression is a measure: DIVIDE(Tasks Done, 17). And the 17 is the amount of tasks one can do. This is sort of fake numbers for now, but I was ideally looking to bucket the progression off 25% buckets (0-25, 26-50, 51-75, 76-100). How would one do this?

PersonIDTasks
22222222Savings
22222222Debt
22222222Timeline
22222222Search
1111111Savings
1111111Search
1111111Timeline
33333Savings
33333Debt
55555Search

 

  • Hi , Anonymous 

    Here are the steps you can refer to :

    (1)This is my test data :

    (2)We can create a measure :

    Measure = var _progression = DIVIDE( COUNT('PPP Task Histogram'[Tasks]) , 8)
    return
    SWITCH(TRUE() , _progression>=0 && _progression<=0.25 ,"0-25" , _progression>0.25 && _progression<=0.5 ,"26-50",_progression>0.5 && _progression<=0.75,"51-75",_progression>0.75 && _progression<=1 ,"76-100",BLANK())

    (3)Then we can put the field on the visual and we will meet your need:

    If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      I tried making a measure like this and I am getting errors 

      PPP Progression Buckets =
      SWITCH(
          TRUE(),
          (SUM('PPP Task Histogram'[PPP Progression]) >= 0 && SUM('PPP Task Histogram'[PPP Progression]) <= 25, "0-25%"),
          (SUM('PPP Task Histogram'[PPP Progression]) >= 26 && SUM('PPP Task Histogram'[PPP Progression]) <= 50, "26-50%"),
          (SUM('PPP Task Histogram'[PPP Progression]) >= 51 && SUM('PPP Task Histogram'[PPP Progression]) <= 75, "51-75%"),
          (SUM('PPP Task Histogram'[PPP Progression]) >= 76 && SUM('PPP Task Histogram'[PPP Progression]) <= 100, "76-100%"),
          "N/A"
      )))))
  • Hi , Anonymous 

    Here are the steps you can refer to :

    (1)This is my test data :

    (2)We can create a measure :

    Measure = var _progression = DIVIDE( COUNT('PPP Task Histogram'[Tasks]) , 8)
    return
    SWITCH(TRUE() , _progression>=0 && _progression<=0.25 ,"0-25" , _progression>0.25 && _progression<=0.5 ,"26-50",_progression>0.5 && _progression<=0.75,"51-75",_progression>0.75 && _progression<=1 ,"76-100",BLANK())

    (3)Then we can put the field on the visual and we will meet your need:

    If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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