Forum Discussion
Measure to Count items in a defined range
Hi there,
I have a simpe measure calculating the % completion in a matrix table, like this:
Measure:
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
- YukiKImpactful 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
)
- AnonymousNot 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...
- YukiKImpactful 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
- AnonymousNot applicable
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