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
Anonymous
Not applicable

How to get Month wise open Count , Close Count and net count

Source and Expected OutputSource and Expected Output

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

here is a workaround for you

create a closecount column

closecount = if(ISBLANK('Table'[closed_date]),0,if('Table'[closed_date]=MAXX(FILTER('Table','Table'[Incident_Number]=EARLIER('Table'[Incident_Number])),'Table'[closed_date]),1,0))

 

then create measures

Open count = DISTINCTCOUNT('Table'[Incident_Number])

Close count = 
CALCULATE(SUM('Table'[closecount]),USERELATIONSHIP('Calendar'[Date],'Table'[closed_date]))

opennet = [Open count]-[Close count]

 

However , I have a question.

1244306, last close in Nov

1250824 , last close in Dec

1050761, last close in Oct.

So should be 1 for Oct, Nov and Dec. How come your result is 2,0,1?

 

please see the attachment below

 





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

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@Anonymous 

here is a workaround for you

create a closecount column

closecount = if(ISBLANK('Table'[closed_date]),0,if('Table'[closed_date]=MAXX(FILTER('Table','Table'[Incident_Number]=EARLIER('Table'[Incident_Number])),'Table'[closed_date]),1,0))

 

then create measures

Open count = DISTINCTCOUNT('Table'[Incident_Number])

Close count = 
CALCULATE(SUM('Table'[closecount]),USERELATIONSHIP('Calendar'[Date],'Table'[closed_date]))

opennet = [Open count]-[Close count]

 

However , I have a question.

1244306, last close in Nov

1250824 , last close in Dec

1050761, last close in Oct.

So should be 1 for Oct, Nov and Dec. How come your result is 2,0,1?

 

please 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_mayu  is there any way to create below column in Measure..? 

Closecount = if(ISBLANK('Table'[closed_date]),0,if('Table'[closed_date]=MAXX(FILTER('Table','Table'[Incident_Number]=EARLIER('Table'[Incident_Number])),'Table'[closed_date]),1,0))

 

Anonymous
Not applicable

@ryan_mayu  Thanks for spending your time on this task.

Yes you're right it should be 1 for Oct. I made mistake on output calculation.

Once agian thank you very much @ryan_mayu .. It's very useful to me. 

Anonymous
Not applicable

For the above post here is the conditions to be maintained. Can some one help me to achive.

Open Count: For a given month, total distinct count that had at least 1 CA that was open as on EOM

Close Count: For a given month, total distinct count for which the last CA was closed in that month

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.