Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PrivateAnalytic
Helper IV
Helper IV

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

PrivateAnalytic_0-1669042630917.png

 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @PrivateAnalytic 

Here are the steps you can refer to :

(1)This is my test data :

vyueyunzhmsft_0-1669084737255.png

(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:

vyueyunzhmsft_1-1669084784957.png

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

View solution in original post

3 REPLIES 3
v-yueyunzh-msft
Community Support
Community Support

Hi , @PrivateAnalytic 

Here are the steps you can refer to :

(1)This is my test data :

vyueyunzhmsft_0-1669084737255.png

(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:

vyueyunzhmsft_1-1669084784957.png

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

amitchandak
Super User
Super User

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"
)))))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.