Search code examples
tableau-apifixed

Fixed Case to calculate a KPI - Tableau


I have a single case which I want to create a KPI for:

If the percentage of part received is higher than 90% is "OK", otherwise is "NOT OK"

I have the following parameter that Im using number of records and CC_Part Received Status the laster paramater is a calculated field which return if the part was receive or not

Im struggling here to do it, so if anyone can help me I will highly appreciate


Solution

  • I have accomplished this using a few calculated fields.

    Since you are using 'Number of Records', the first will give you the total number of records per part number:

    {FIXED [Part Number]: sum([Number of Records])}
    

    From there, I am able to make an equation which uses the above as the denominator.

    If [CC_PartReceivedStatus] = 'Yes' then 
        ([Number of Records])/([Fixed Num of Records]) 
    END
    

    Now I have a percentage of parts received, which looks like this:

    enter image description here

    Removing all the intermediary fields and leaving only part number I get this:

    enter image description here

    Finally, a quick calculated field can give you the 'OK' and 'NOT OK':

    If SUM([Percentage Received]) > .9 Then 'OK' 
    Else 'NOT OK' 
    END
    

    There may be some things that require adjustment or fine tuning in your data, but they can all be placed accordingly into the above calculated fields. Hopefully the ideas here get you started down the right path.