# App Development

cancel
Showing results for
Did you mean:
Contributor III

## KPI Count based on the measure

Hi,

I have the following data,

PartNumber   Supplier            Status

A1                        S1                       Red
A1                        S2                       Green
A1                        S3                       Green
A2                        S4                       Red
A3                        S5                       Green
A3                        S6                       Green

With this as measure

= Count( {< Status={'Green'} >} distinct [PartNumber]) /   Count(distinct If( LEN(Status)>0, PartNumber))

I can create this table to report the Green status per the total, by PartNumber.

PartNumber    Status_Green
A1                         66.6%                <- 2 out of 3 entries are green
A2                           0.0%                <- 0 out of 1 entries are green
A3                      100.0%                <- 2 out of 2 entries are green

How can I create a KPI to count the Part Numbers with Status_Green = 100%. In this case, the KPI = 1.

Thanks in advance for all the help.

Labels (4)

• ### measure

1 Solution

Accepted Solutions
MVP

@A7R3  Try:

=Count(DISTINCT {<PartNumber={"=Count( {<Status={'Green'}>} PartNumber)=Count( PartNumber)"}>}PartNumber )

3 Replies
MVP

@A7R3  Try:

=Count(DISTINCT {<PartNumber={"=Count( {<Status={'Green'}>} PartNumber)=Count( PartNumber)"}>}PartNumber )

Contributor III
Author

Hi Tresesco,

May I know how to read this expression?

The statement is structurally correct, but give a wrong number. I need to count the products when it meets the condition of all part number are having status of green.

``=Count({<Status={'Green'}>}PartNumber)/Count(PartNumber)``