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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
TechR21
Helper V
Helper V

Grouping of calls to use in a report

Hi,

 

Im trying to create the following in PowerBI. All open calls (calls that dont have a completion date), in a stacked column chart, where a selection is made on how long a call is already open, with status of the call (status: in progress, on hold, awaiting, in transfer). So this should be counted from the calldate (startdate) of the call, and with the use of the current date at that moment to determine how long a call is open.

 

Untitled picture.png

How many days a call is open, should determine in what "group" it will be in above visual. For example see the following table:

 

curre.png

 

The following tables I use:

 

Calls ; contains all incoming calls

  • Callid (id of the call, number of calls)
  • Calldate (startdate )
  • Completiondate (when a call is closed)

Both calldate and completiondate have a date hierarchy with year, month, and days

 

Status ; which contains following statuses:

  • Logged
  • awaiting
  • In progress
  • On hold
  • In transfer
  • Closed

I use a filter to exclude the "logged" and "closed" status to only get the open calls

 

How can I group the calls together based on the time they are open??

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @TechR21 

 

Based on the data you provide.

Column:

days a call is open = [Current date]-[Call date]+1

vzhangti_0-1668159090821.png

Group = SWITCH(TRUE(),
[days a call is open]<=2,"2days",
[days a call is open]>2&&[days a call is open]<=5,"2-5days",
[days a call is open]>5&&[days a call is open]<=7,"5-7days",
[days a call is open]>7&&[days a call is open]<=14,"1-2weeks",
[days a call is open]>14&&[days a call is open]<=28,"2-4weeks",
[days a call is open]>28&&[days a call is open]<=61,"1-2months",
[days a call is open]>61,">2months")

vzhangti_1-1668159130511.png

vzhangti_2-1668159158386.png

If this is not the result you expect, please provide more information.

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @TechR21 

 

Based on the data you provide.

Column:

days a call is open = [Current date]-[Call date]+1

vzhangti_0-1668159090821.png

Group = SWITCH(TRUE(),
[days a call is open]<=2,"2days",
[days a call is open]>2&&[days a call is open]<=5,"2-5days",
[days a call is open]>5&&[days a call is open]<=7,"5-7days",
[days a call is open]>7&&[days a call is open]<=14,"1-2weeks",
[days a call is open]>14&&[days a call is open]<=28,"2-4weeks",
[days a call is open]>28&&[days a call is open]<=61,"1-2months",
[days a call is open]>61,">2months")

vzhangti_1-1668159130511.png

vzhangti_2-1668159158386.png

If this is not the result you expect, please provide more information.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

perfect! i figured it out, thank you

amitchandak
Super User
Super User

@TechR21 , Not clear on the ask.

You can get Days in a new column

datediff([Call date], today(), day)

 

Then you can use switch to create the group

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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