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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
torbenani
Frequent Visitor

Count open support case

For a service desk application, I want to count the number of open cases a any given time. I have tow date columns "CreatedDate" and "SolutionDate". I case is considered to be open at any "given date" if: 

CreatedDate < "given date" AND

SolutionDate > "given date" OR SolutionDate is BLANK
I've tried the COUNTROWS in DAX with filters, but cant make i work. Any help is appreciated.

My objective is to ceate a chart, which week by week show the development in the number of cases.

Thanks.

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

@torbenani 

Oh, sorry, my bad

Open Cases = 
CALCULATE(COUNTROWS(Table), 
FILTER(ALL(Table), 
Table[CreatedDate] < SELECTEDVALUE('Calendar Table'[Date]) && 
(Table[SolutionDate] > SELECTEDVALUE('Calendar Table'[Date]) || ISBLANK(Table[SolutionDate]))
)
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @torbenani ,

 

Please check following steps as below.

1# Create calculated table.

CALENDAR = CALENDAR(MIN('Table'[Created_on]),TODAY())

2# Create measures.

isopen =
IF (
    SELECTEDVALUE ( 'Table'[Created_on] ) <= SELECTEDVALUE ( 'CALENDAR'[Date] )
        && (
            SELECTEDVALUE ( 'Table'[Closed_on] ) >= SELECTEDVALUE ( 'CALENDAR'[Date] )
                || ISBLANK ( SELECTEDVALUE ( 'Table'[Closed_on] ) )
        ),
    1,
    0
)

counts = SUMX('Table',[isopen])

 3# Use 'CALENDAR'[Date] as slicer.

Result would be shown as below.

2.PNG3.PNG

 

Best Regards,

Jay

Community Support Team _ Jay Wang

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

amitchandak
Super User
Super User

@torbenani , refer this blog can help you

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
az38
Community Champion
Community Champion

Hi @torbenani 

the best practice would be to create a calendar table

Calendar Table = CALENDAR(MIN(Table[CreatedDate]), MAX(Table[SolutionDate]) )

the add to it a measure

Open Cases = 
CALCULATE(COUNTROWS(Table), FILTER(ALL(Table), 
Table[CreatedDate] < SELECTEDVALUE('Calendar Table'[Date]) && (Table[SolutionDate] > SELECTEDVALUE('Calendar Table'[Date]) OR ISBLANK(Table[SolutionDate]))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hi AZ38
Thanks a lot for your help. When I use the measure, I get " The syntax for 'OR' is incorrect. "Could you gudie me.

Open Cases =
CALCULATE(COUNTROWS(Bi_RequestService), FILTER(ALL(Bi_RequestService),
Bi_RequestService[createDate] < SELECTEDVALUE('Calendar'[Date]) && (Bi_RequestService[solutionDate] > SELECTEDVALUE('Calendar'[Date]) OR ISBLANK(Bi_RequestService[solutionDate]))

Thanks

 
az38
Community Champion
Community Champion

@torbenani 

Oh, sorry, my bad

Open Cases = 
CALCULATE(COUNTROWS(Table), 
FILTER(ALL(Table), 
Table[CreatedDate] < SELECTEDVALUE('Calendar Table'[Date]) && 
(Table[SolutionDate] > SELECTEDVALUE('Calendar Table'[Date]) || ISBLANK(Table[SolutionDate]))
)
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

az38 - Thanks for your help. This works perfect.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.