Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Weighted Average of RTY

Hi all,   I've been trying to compute a weighted average of Roll Throughput Yield (RTY) using a DAX Measure, this would ideally compute at aggregations across multiple days and production lines.  I...
  • Anonymous's avatar
    Anonymous
    4 years ago

    I was ultimately able to determine the right function.  You need to pre-calculate the table then group by and calculate.  That will ensure the correct order of operations.

     

    RTY Summary = 
    
    var opSummary = 
        SUMMARIZE(
            FTT
            ,[LINE],[OPERATIONNAME],[DATE],[Key Station]
            ,"FPY",DIVIDE(SUMX(FTT,[PASS]),SUMX(FTT,[TOTAL]),0)
            ,"TOTAL",sumx(ftt,[TOTAL])
            ,"KEY_TOTAL",sumx(FILTER(ftt,[Key Station]=True),[TOTAL])
        )
    
    var lineSummary = 
        GROUPBY(opSummary,[LINE],[DATE]
            ,"RTY",PRODUCTX(CURRENTGROUP(),[FPY])
            ,"LINE_TOTAL",SUMX(CURRENTGROUP(),[KEY_TOTAL])
    )
    
    return 
    
    CALCULATE(
        DIVIDE(
            SUMX(lineSummary,[RTY]*[LINE_TOTAL]),
            SUMX(lineSummary,[LINE_TOTAL])
        )
    )