Forum Discussion
Defect Rate Formula
- 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
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
So I am taking this formula a few steps further and I am stuck. Below I have added in DefectReason that is not AB Damage, I also need to add in that the DefectReason is not Concealed Damage or Goodwill. I tried with a comma but it does not like it. How can I add more?
UnfilterDefectRate = DIVIDE(
CALCULATE(
SUM ( vSalesMaster[WarrDetail.InvoiceQty] ),
FILTER (vSalesMaster,vSalesMaster[OrderType] = "W" &&
vSalesMaster[WarrDetail.DefectReason] <> "AB Damage" )
),
CALCULATE(
SUM ( [InvoiceQty] ),
FILTER (VSalesMaster,vSalesMaster[OrderType] = "R")
)
)