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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
jdwalker5
Helper II
Helper II

Measure to Count A Value If It Is Within Percentage Range

Hello.  I am trying to recreate the below table in Power BI.  To explain the data, shipping location A delivers to a total of 137 stores.  10 of those stores delivered on time 0-49% of the time, 13 of those stores delivered on time 50-59% of the time, etc.

How do I get the counts for each percentage range?

 

Shipping Location0 to 49%50 to 59%60 to 69%70 to 79%80 to 90%90 to 94%95 to 100%Total Stores
A10131531161537137
B1171522302390
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @jdwalker5 

 

I have simulated the data to answer your question.

vzhangti_0-1636940073328.png

 

Measure:
Count = 
COUNTROWS (
    FILTER (
        ALL ( 'Table' ),
        [Range] = MAX ( 'Table'[Range] )
            && [Shipping Location] = MAX ( 'Table'[Shipping Location] )
    )
)

 

vzhangti_1-1636940108471.jpeg

 

Best Regards,

Community Support Team _Charlotte

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

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-zhangti
Community Support
Community Support

Hi, @jdwalker5 

 

I have simulated the data to answer your question.

vzhangti_0-1636940073328.png

 

Measure:
Count = 
COUNTROWS (
    FILTER (
        ALL ( 'Table' ),
        [Range] = MAX ( 'Table'[Range] )
            && [Shipping Location] = MAX ( 'Table'[Shipping Location] )
    )
)

 

vzhangti_1-1636940108471.jpeg

 

Best Regards,

Community Support Team _Charlotte

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

Thank you for the reply.  I ended up doing something similar to the approach you provided and it worked.

MFelix
Super User
Super User

Hi @jdwalker5 

 

Not sure how you model is setup but you can create a table with the percentages and the maximum and minimum values:

 

MFelix_0-1636734891474.png

Thelast row is a little bit higher than 100% because has you can see in order to get all the value the maximim is equal to the minimum of the previous category.

 

Now add the following measure:

Total Stores = 
COUNTROWS (
    CALCULATETABLE (
        GROUPBY( Detaisl, Detaisl[Store], Detaisl[Percentage] ),
        Detaisl[Percentage] >= MIN ( 'Range Limits'[Minimum] )
            && Detaisl[Percentage] < MAX ( 'Range Limits'[Maximum] )
    )
)

 

MFelix_1-1636734993079.png

 

See attach PBIX file.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Thanks for the reply.  This would also work for what I needed so I will keep this in my toolbox!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.