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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
csettine
Regular Visitor

Generating grouped category counts against dynamic ranges

I'm trying to convert an excel report to Power BI:

 

I've got a table of monthly sales by country and city, and they need to be grouped in percentile buckets. The buckets aren't equidistant, it's set up in a gradient [0, 1, 5, 10, 15, 20, 25, 30, 40...70, 75, 85, 90, 95, 99]. They're stored as a seperate lookup table and then are referenced to build the counts, which I originally did via python and inserted into the final excel spreadsheet.

 

City Name0th Percentile1st Percentile5th Percentile10th Percentile15th Percentile20th Percentile25th Percentile30th Percentile40th Percentile50th Percentile60th Percentile70th Percentile75th Percentile80th Percentile85th Percentile90th Percentile95th Percentile99th Percentile
Barcelona$360,000$520,000$645,000$715,000$770,000$795,000$825,000$855,000$920,000$985,000$1,060,000$1,120,000$1,170,000$1,230,000$1,280,000$1,370,000$1,540,000$2,230,000
Paris$85,000$120,000$360,000$460,000$545,000$600,000$660,000$720,000$780,000$860,000$950,000$1,070,000$1,130,000$1,210,000$1,350,000$1,570,000$1,930,000$2,840,000
London$45,000$160,000$250,000$300,000$330,000$350,000$370,000$390,000$445,000$530,000$645,000$765,000$815,000$885,000$995,000$1,140,000$1,340,000$1,990,000

 

The end result needs to look like the table below, with the number of sales for each city by percentile bucket. Is this doable in Power BI? I'm pretty new to Power BI so I'm not sure if it needs to be done via DAX or in the transform data window (maybe a merge or related column...?). Haven't seen anything on the forum or youtube that quite covers this (a lot of group and counts by dynamic dates) but if there is I'd love to be pointed in the right direction. 

 

 Sales Counts by Percentile
City015101520253040506070758085909599
Dublin3111211375137642624420
London032046447341320220
Paris0111724141310273433291119221618120
Barcelona0345163533634578782503720422623115
Athens1141110141013182420147778320

 

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @csettine 

Thanks for reaching out to us.

>> The end result needs to look like the table below, with the number of sales for each city by percentile bucket. 

Can you describe how you calculated these counts? so that I can translate the calculation logic you said into measure code. Thanks.

vxiaotang_0-1660015125680.png

 

 

Best Regards,

Community Support Team _Tang

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

csettine
Regular Visitor

oops the table didn't copy paste well....apologies the format looks a bit funky I'm not sure how to edit.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors