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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Measure to Count items in a defined range

Hi there,

I have a simpe measure calculating the % completion in a matrix table, like this:

JulioYYC_0-1675958017069.png

Measure:

JulioYYC_1-1675958124618.png

I would need now a measure to count how many activities is a range of %Completion.

In the given example above, the outcome would be as per below:

0% to 5% -> 0 activities

6% to 30% -> 0 activites 

31% to 60% -> 4 activities

61% to 90%  -> 2 activities

> 90% -> 4 activities

 

Hope someone can help with that!

 

thanks!

5 REPLIES 5
Rolina
Helper I
Helper I

hi, have you found solution for that? i need to create something similar, but not with the percentage but with numbers range, so the calcs shows:

between 0 - 10 - XX items

between 11-20 - XY items

between 21-30 - XZ items

between 31-40 - ZY items

over 40 - ZZ items

YukiK
Impactful Individual
Impactful Individual

Measure like this one should work:

 

YOURMEASURE =

SWITCH( TRUE, 

    AND([%Completion] >= 0.01, [%Completion]< 0.30 ), 0,

    AND([%Completion] >= 0.30, [%Completion]< 0.60 ), 4,

    etc

)

Anonymous
Not applicable

Hi YukiK, thanks for replying!

Actually I need a measure to make the count of activities based on the range of %. This number will float over the time.. the numbers I showed above are one example based on my current table. Like in in the future, I can have 30 activities between 30% and 60% comletion...

YukiK
Impactful Individual
Impactful Individual

I see. You can do something like this:

0% ~ 5% = 
CALCULATE(
    COUNTROWS(your table),
    FILTER( 
        ALL(your table),
        [%Completion] >= 0,
        [%Completion] <= 0.05
    )
)

 

This should be a good starting point at least!

 

Please consider giving it a thumbs up and accept as a solution if this was helpful

Anonymous
Not applicable

Hi Yukik,

It seems that the secons argument is not valid entry in this function:

 

JulioYYC_0-1676065625132.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

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.