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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Kebas_Leech
Helper I
Helper I

Possible Bucketing

Hello everyone,

 

I have a simple measure that calculates the % of losses that I have: [% losses] = Divide ( loss, allquantity)

What I'm trying to figure out is a way to filter that measure, [%losses], given certain criteria. 

Example: which is the total [%losses] when considering values that are less than 5%, 10% and so on, like its shows in the following graph:

 

Kebas_Leech_0-1695646578730.png

 

I thought this was a case of dynamic sgmentation/bucketing but i cant seem to make it work.

Any ideas?

 

Thanks

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

Hi @Kebas_Leech ,

 

I suggest you to create a Percentage table to help your calculation.

Percentage = 
GENERATESERIES(0,1,0.05)

vrzhoumsft_0-1695805535240.png

Measure:

Measure = 
CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER('Table',[% losses]<=MAX(Percentage[Percentage])))

Result is as below.

vrzhoumsft_1-1695805587458.png

 

Best Regards,
Rico Zhou

 

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-rzhou-msft
Community Support
Community Support

Hi @Kebas_Leech ,

 

I suggest you to create a Percentage table to help your calculation.

Percentage = 
GENERATESERIES(0,1,0.05)

vrzhoumsft_0-1695805535240.png

Measure:

Measure = 
CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER('Table',[% losses]<=MAX(Percentage[Percentage])))

Result is as below.

vrzhoumsft_1-1695805587458.png

 

Best Regards,
Rico Zhou

 

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

 

 

Hello @v-rzhou-msft 

 

First of all, I want to personally thank you for using your time to help me.

It worked, I made some adjustments but overall, what was missing was the generateseries.

 

Thanks again.

Kindly

 

lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors