Forum Discussion
Jingspat
9 years agoFrequent Visitor
Sum with filtering on multiple columns
I want to be able to get a total for Call Time if the name is in either Call From or Call to. The table looks like this:
| Call Date | Call From | Call To | Call Type | Call Time (seconds) | Talk Time (seconds) |
| 6/15/2017 11:23 AM | Name 1 <312> | 1234567891 | outgoing | 10 | 0 |
| 6/15/2017 11:23 AM | 9876543211 | Name 1 <312> | incoming | 14 | 11 |
| 6/15/2017 11:23 AM | Name 2 <319> | Name3 <332> | outgoing | 56 | 42 |
How do I create that measure?
4 Replies
- v-ljerr-msftMicrosoft Employee
Hi Jingspat,
If I understand you correctly, you should be able to use the formula below to create a new measure to calculate the total call time in your scenario. :smileyhappy:
Total Call Time = CALCULATE ( SUM ( Table1[Call Time (seconds)] ), FILTER ( Table1, FIND ( "Name", Table1[Call From],, 0 ) > 0 || FIND ( "Name", Table1[Call To],, 0 ) > 0 ) )Regards
- JingspatFrequent Visitor
Thanks so much for the response v-ljerr-msft!!! We have hundreds of varying names, if I understand your propopsed solution, that would just search by one name. Is it possible to have it show the total talk time for all names?
- v-ljerr-msftMicrosoft Employee
Hi Jingspat,
Could you try the formula below to see if it works? :smileyhappy:
Total Call Time = CALCULATE ( SUM ( Table1[Call Time (seconds)] ), FILTER ( Table1, FIND ( "<", Table1[Call From],, 0 ) > 0 || FIND ( "<", Table1[Call To],, 0 ) > 0 ) )Regards