Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
adminclikalia
Frequent Visitor

URGENT: Report Calls retrieve by call center agents

Hello! I have a problem with a power bi table that I need to show.

 

The business problem is that the call centre team needs to know what are the calls that were retrieved (in table format). What I need to calculate is the inbounds calls that were missed but in the next 24, 48 or 72 hrs someone of our team called the customer again (outbound call). To check if the call were answered, the column answered need to be as "Yes". The problem is that my current table have a format that is difficult to handle.

 

Here is an example of my table:

DateDate - Answered atDate - Ended atDate - Started atDirectionUser Name (Agent)Raw Digit (cliente number)Number digit (our number)Missed Call reasonAnswered
01/07/2021 7:15:5001/07/2021 7:15:0501/07/2021 7:16:0501/07/2021 7:14:50InboundChristian+34454545+34606060Not available agentno
02/07/2021 12:15:4502/07/2021 12:15:3002/07/2021 12:15:4502/07/2021 12:15:45OutboundChristian+34454545+34606060-yes
03/07/2021 10:40:4003/07/2021 10:40:1503/07/2021 10:40:5503/07/2021 10:40:05InboundJorge+34222222+34111111Out of working hoursno
04/07/2021 16:45:3004/07/2021 16:45:1004/07/2021 16:45:5504/07/2021 16:45:05OutboundMonica+34222222+34333333-yes

 

 

Thank you for your suppport.

 

 

 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @adminclikalia ;

You could create a column as follows:

Answered72 = 
var _sta=CALCULATE(MIN([Date - Answered at]),FILTER(ALLEXCEPT(logs,'logs'[Custom.data.raw_digits]),[Direction]="Inbound"))
var _end=CALCULATE(MIN([Date - Answered at]),FILTER(ALLEXCEPT(logs,logs[Custom.data.raw_digits]),[Direction]="Outbound"))
return IF([Direction]="Outbound"&&DATEDIFF(_sta,_end,HOUR)<=72,"yes","no")

The final output is shown below:

vyalanwumsft_0-1627883935902.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-yalanwu-msft
Community Support
Community Support

Hi, @adminclikalia ;

You could create a column as follows:

Answered72 = 
var _sta=CALCULATE(MIN([Date - Answered at]),FILTER(ALLEXCEPT(logs,'logs'[Custom.data.raw_digits]),[Direction]="Inbound"))
var _end=CALCULATE(MIN([Date - Answered at]),FILTER(ALLEXCEPT(logs,logs[Custom.data.raw_digits]),[Direction]="Outbound"))
return IF([Direction]="Outbound"&&DATEDIFF(_sta,_end,HOUR)<=72,"yes","no")

The final output is shown below:

vyalanwumsft_0-1627883935902.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tex628
Community Champion
Community Champion

Hi, 

Try this calculated column for answered outbound calls within 24H:

 

Answered within 24 =
VAR nr = [Raw Digit (cliente number)]
VAR time_ = [Date - Started at]

IF ( AND( [Direction] = "Inbound" , [Answered] = "no" ) , 

CALCULATE( COUNTROWS ( 'Table' ) , 
[Direction] = "Outbound" ,
[Answered] = "yes"
[Raw Digit (cliente number)] = nr ,
[Date - Started at] >= time_ ,
[Date - Started at] <= time_ +1
)
 

 


If this works you should be able to simply change the +1 to +2 or +3 to get the other timeintervals covered. 

Br, 
J


Connect on LinkedIn

Hi Br, I tried to add the calculated column, but It gives me an error. Do you have other idea to solve this?

 

Thank you very much for your help.

Can you take a pictue of the error? 


Connect on LinkedIn

The syntax for 'IF' is incorrect. (DAX(VAR nr = logs[Custom.data.raw_digits]VAR time_ = logs[Date - Started at]IF(AND(logs[Custom.data.direction] = "Inbound",logs[Custom.data.missed_call_reason] <> BLANK()), CALCULATE( COUNTROWS ( 'logs' ) , logs[Custom.data.direction] = "Outbound" ,logs[Custom.data.answered_at] <> BLANK(),logs[Custom.data.raw_digits] = nr ,logs[Date - Started at] >= logs[Date - Started at] ,logs[Date - Started at] <= logs[Date - Started at] +1), BLANK()))).

I add a return after the VAR definition and the calculated column works but the problem is that all values are BLANCK

 

Answered within 24 =
VAR nr = logs[Custom.data.raw_digits]
VAR time_ = logs[Date - Started at]
return
IF(AND(logs[Custom.data.direction] = "Inbound",logs[Custom.data.missed_call_reason] <> BLANK()),

CALCULATE( COUNTROWS ( 'logs' ) ,
logs[Custom.data.direction] = "Outbound" ,
logs[Custom.data.answered_at] <> BLANK(),
logs[Custom.data.raw_digits] = nr ,
logs[Date - Started at] >= time_ ,
logs[Date - Started at] <= time_ +1
), BLANK())

Hi, 

Take a look at the attached file. 

Br, 
J


Connect on LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors