Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Defect Rate Formula

I am VERY new to PowerBI and have been struggling with calculating a defect rate for weeks. Please help!   I have a table that has R (regular) and W (warranty) orders. I want to divide the InvoiceQ...
  • Vvelarde's avatar
    9 years ago

    Anonymous

     

    Hi, are using DAX in Query Editor (This use Power Query Language).

     

    To obtain this you can create a New Measure.

     

    DEFECTRATE =
    DIVIDE (
        CALCULATE (
            SUM ( [InvoiceQty] ),
            FILTER ( YOURTABLE, YOURTABLE[OrderType] = "W" )
        ),
        CALCULATE (
            SUM ( [InvoiceQty] ),
            FILTER ( YOURTABLE, YOURTABLE[OrderType] = "R" )
        )
    )

    Regards

     

    Victor

    Lima - Peru