Forum Discussion
Sum and average with multiple filters
- 5 years ago
Try something like below for average with multiple conditions.
Dias_AprobOK = CALCULATE ( AVERAGE ( Data[Total Term] ), Data[Estado_Aprob] = "APPROVED", Data[Meets deadline] = "OK" )Or
Dias_AprobOK = AVERAGEX ( FILTER ( Data, Data[Estado_Aprob] = "APPROVED" && Data[Meets Deadline] = "ok" ), Data[Total Term] )If you want a blank value to appear like a zero, you can add +0 at the end of your formula. Something like
Dias_AprobOK = AVERAGEX ( FILTER ( Data, Data[Estado_Aprob] = "APPROVED" && Data[Meets Deadline] = "ok" ), Data[Total Term] ) + 0You can use && to connect multiple filtering conditions. See DAX syntax.
Let me know if you have any questions.
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Try something like below for average with multiple conditions.
Dias_AprobOK =
CALCULATE (
AVERAGE ( Data[Total Term] ),
Data[Estado_Aprob] = "APPROVED",
Data[Meets deadline] = "OK"
)
Or
Dias_AprobOK =
AVERAGEX (
FILTER ( Data, Data[Estado_Aprob] = "APPROVED" && Data[Meets Deadline] = "ok" ),
Data[Total Term]
)
If you want a blank value to appear like a zero, you can add +0 at the end of your formula. Something like
Dias_AprobOK =
AVERAGEX (
FILTER ( Data, Data[Estado_Aprob] = "APPROVED" && Data[Meets Deadline] = "ok" ),
Data[Total Term]
) + 0
You can use && to connect multiple filtering conditions. See DAX syntax.
Let me know if you have any questions.
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Sorry for the delay in responding, I was solving other issues.
Thank you very much for the solution, I was able to try the 3 formulas and they work perfectly.
Thanks again
Shortly I will write new doubts