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
jdogcisco
Resolver I
Resolver I

Plotting Open/Closed in same table/graph...

Hello,

 

I am importing a single csv ("issues") of case/ticket date. Each row is a case and its details including, but not limited to...

Ticket #, Opened, Closed
1, 1/2/18, 1/5/18
2, 1/3/18,
3, 1/4/18, 1/5/18

So, every row has an "Opened" date, but not every row has a "Closed" date.

 

I've read some other posts around this area, but I'm just not getting the data to look right.

I created a separate "Calendar" table and created relationships to the "Date" field with the "Opened" and "Closed" fields in the "issues" table.

 

I created two measures...

CreatedCount = COUNTROWS(issues)

ClosedCount = CALCULATE(COUNTROWS(issues),USERELATIONSHIP('Calendar'[Date],issues[Closed]),NOT(ISBLANK(issues[Closed])))

 

When I add these measures to a table or chart, I only see a single value.  Not a count per date period...

 

Screen Shot 2018-06-07 at 6.30.47 PM.png

 

 

At one point, I did get the "CreatedCount" to list the count per year, but then that stopped working and I dont' know why. I never got the "ClosedCount" to work.

 

Any help is appreciated.

1 ACCEPTED SOLUTION

Hi,

 

So, I appreciate the reply.  I'm not entirely sure why this worked, but to solve this I needed to change my "Created" column (the timestamp of when the case was opened) and "Closed" column from datetime to date. I'm not sure why this worked.  Maybe because the time never lined up with the time in the Calendar table and reducing the timestamp to just a date allowed it to find a match. Not sure.  Regardless, exhausting....haha

 

Screen Shot 2018-06-08 at 8.02.30 AM.png

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

You can try to use the following DAX to get the ClosedCount

 

ClosedCount = CALCULATE(COUNTROWS(Issues),FILTER(Issues,ISBLANK(Issues[Closed])<>FALSE()))

2018-06-08_9-56-36.png

 

 

 

Thanks for the reply.  That just give me a single number like the command I previously listed for "ClosedCount".  But, rather than the closed count, it gives me the open count (because it's counting the blanks).

 

The expected output is like below (taken from another post here):

Screen Shot 2018-06-07 at 8.21.38 PM.png

 

But what I'm getting are just a single, total number (I used your suggestion for the "ClosedCount" column:

Screen Shot 2018-06-07 at 8.23.30 PM.png

Anonymous
Not applicable

Do you want the following results shown in the table? Did you try the Matrix by expending the data?

 

2018-06-08_14-45-13.png 

 

 

 

Hi,

 

So, I appreciate the reply.  I'm not entirely sure why this worked, but to solve this I needed to change my "Created" column (the timestamp of when the case was opened) and "Closed" column from datetime to date. I'm not sure why this worked.  Maybe because the time never lined up with the time in the Calendar table and reducing the timestamp to just a date allowed it to find a match. Not sure.  Regardless, exhausting....haha

 

Screen Shot 2018-06-08 at 8.02.30 AM.png

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.