Forum Discussion
Syndicate_Admin
Administrator
5 years agoSum and average with multiple filters
Hello everyone. I have a table with data of procedures carried out, such as the following: Codigo_Obra Through Estado_Aprob Total Term Meets deadline 2609 15401 APPROVED 42 Defeated ...
- 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.
Syndicate_Admin
Administrator
5 years agoI add to the above that also when I have no data the word white appears and I would like it to look like a zero