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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
JViggiani
New Member

Counting the number of items for a certain date

Hi everyone,

 

I have the database ESD_ReqIncProb for a service desk ticket system open as a table in PowerBI. I also have defined a second dable which is just a list of Dates.

 

ESD_ReqIncProb is just a list of the tickets and their details and has the following relevent information on it:

 

  • Ticket Reference [EFOLDERID]
  • Current ticket status (opened, closed) [Status]
  • Date / time opened [tStartDateTime]
  • Date closed [ClosedDate]

 

Currently, if I try to plot a graph of the count of number of EFOLDERIDs, on an axis of tStartDateTime, filtered by status, I get "the current status of tickets currently sitting in our queue in the queue from eg October 2017 to eg November 2017".

 

What I am after is a graph of "the number of tickets originally opened / closed in October 2017 to November 2017" so that we can see whether more tickets are being opened or closed.

 

There is a big difference between the two. The former can be looked at simply by looking at the current "status" of the ticket but the status changes over time.

 

I created a new table (Date) with a list of dates in it defined by the oldest ticket. This was done with the following formula:

 

Date = CALENDAR ( MIN ( ESD_ReqIncProb[tStartDateTime] ), TODAY () )

This just prints a column of dates in a new table called Date between the date of the oldest logged ticket and the current day.

 

 

I then would like for the system to count the number of tickets opened on each one of these dates. I have tried the code:

 

CallsOpened = 
CALCULATE (
    COUNTA( ESD_ReqIncProb[EFOLDERID] ),
    FILTER (
        ESD_ReqIncProb,
        ESD_ReqIncProb[tStartDateTime].[Date] = RELATED ( 'Date'[Date] )
    )
)

How this should work in theory:

 

  1. Count all of the entries [EFOLDERID] in the database ESD_ReqIncProb
  2. Filter this related table to only count the values where the date of the ticket opened is equal to the Date present on the ajacent row.

Instead, this counts all tickets. The filter seems to do nothing.

 

Please can someone help me? Smiley Mad

 

Cheers!

1 ACCEPTED SOLUTION
dramus
Continued Contributor
Continued Contributor

You are close, this worked for me. I added the column to the Dates table.

 

CallsOpened = 
CALCULATE (
    COUNTA( ESD_ReqIncProb[EFOLDERID] ),
    FILTER (
        ESD_ReqIncProb,
        ESD_ReqIncProb[tStartDateTime].[Date] = [Date] )
    )
)

 

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

Share the link from where i can download your file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
dramus
Continued Contributor
Continued Contributor

You are close, this worked for me. I added the column to the Dates table.

 

CallsOpened = 
CALCULATE (
    COUNTA( ESD_ReqIncProb[EFOLDERID] ),
    FILTER (
        ESD_ReqIncProb,
        ESD_ReqIncProb[tStartDateTime].[Date] = [Date] )
    )
)

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.