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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

Open Ticket Count

Hi Everyone,

 

I have a below requirement and I am struggling to get this done and looking for some help. If anyone has any suggestions on how to acheive this, please let me know and that would be really helpful and appreciated. 

 

My requirement is we need to show all the count of OPEN cases based on when the case was opened and when it was closed. Example if the case is opened on 01/01/2021 and closed on 05/01/2021, in this case we need to count this case as '1' open case count in all the months of JAN, FEB, MAR and APRIL and we should not count for MAY as the case was closed in the month of MAY.

 

Note: In-my case my source of data is raw file (excel) and I am importing this excel raw file into Power BI and from there working on this requirement. Below is the output screenshot that I have to acheive, currently I have did everything manually in spreadsheet to show my scenario. Columns Jan 21 to Mar 22 are not on my data set, I have only Ticket number, State, Actual Start and Actual End column, I do have calendar table.

 

Screenshot 2022-07-17 073731.png.

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

 

I create a sample by your data. My calendar table is as below.

DimDate =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2021, 01, 01 ), DATE ( 2022, 03, 31 ) ),
    "MonthYear",
        YEAR ( [Date] ) * 100
            + MONTH ( [Date] ),
    "MonthYearName", FORMAT ( [Date], "MMM-YY" )
)

Please try my codes to create measures.

Basic Flag = 
VAR _Actual_start = MAX('Table'[Actual start])
VAR _Actual_end = MAX('Table'[Actual end])
VAR _Month_end = MAX(DimDate[Date])
RETURN
IF(_Actual_start<=_Month_end,IF(_Actual_end = BLANK() || _Actual_end>=_Month_end,1,BLANK()))
Sum = 
SUMX(VALUES('Table'[ID]),[Basic Flag])

Result is as below.

RicoZhou_0-1658308193103.png

 

Best Regards,
Rico Zhou

 

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

 

Anonymous
Not applicable

Hi Rico,

 

Thank you for the help, for some reason still i am not able to get the expected result set, here is the expected result set but i am getting 12 for the month of Feb 2021

this is the expected resultthis is the expected resultFiltered on End date (tickets opened and closed on Jan and Feb)Filtered on End date (tickets opened and closed on Jan and Feb)Filter on Actual startFilter on Actual startfor feb it is showing 12 it should be 23for feb it is showing 12 it should be 23

ryan_mayu
Super User
Super User

@Anonymous 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi Ryan,

 

Thank you for your help, it is working fine for Jan month but from Feb it is not giving accurate numbers, it is giving what ever the open count left from JAN which are closed in feb for example if the Jan have 10 tickets and 2 got closed in Jan itself then Jan count is 8 this is working fine but from that 8 tickets if 2 were closed in Feb it is giving remaining 6 count for Feb it is not adding Feb opened ticket count.

 

Thanks.

 

 

@Anonymous 

i updated the sample data.

1.PNG2.PNG

like what you said, 10 tickets in Jan and 2 closed in Jan, then the result for jan is 8.

2 tickets colsed in Feb and one open in Feb, the the result for Feb is 8-2+1=7





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.