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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ERIC_A
Helper II
Helper II

Ticket Open and Closed DistinctCount

Hello,

I have the following Table 

Ticket Open DateClosed Date
A1/1/20231/1/2023
B1/1/20231/1/2023
C2/1/20232/1/2023
D2/4/2023

2/1/2023

 

E12/31/20221/1/2023
F2/1/20232/1/2023

 

This table1 is connected to a calendar table for Open Date (active) Closed Date (not active).

I need to make the total count of tickets open + tickets closed on a specific date. The problem I have is that I don't know how to make a distinct count of my total open and total closed formula. Details below :

Tickets opened on 01/01/2023 
2A,B
Tickets Closed on 01/01/2023 
3A,B,E
Tickets opened/closed on 01/01/2023 
5A,B,A,B,E
Expected  
3A,B,E

How can I make a formula to sum tickets opened +tickets closed and then make the distinctcount out of it?

DAX I have 

totalClosed = calculate(DISTINCTCOUNT('Data'[ticket]),USERELATIONSHIP('Calendar'[Date],'Data'[Closed Date]))

totaltickets = distinctcount('Data'[ticket]')+totalClosed

Thank you ! 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1706238511753.png

 


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

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1706238511753.png

 


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

hi Ashish thank you for your PBIX. your approach is interesting and is similar of what I did yesterday. 

here is how I solved it .

 

I created  a union table with the tickets and open date + tickets and closed date. 

Open+Closed = union(
SELECTCOLUMNS('Data',"Ticket",'Data'[Incident],"Date",'Data'[Tkt Crtn Date]),
SELECTCOLUMNS('Data',"Ticket",'Data'[Incident],"Date",'Data'[SolutionAppliedDate]))

 

and then I used this to obtain the distinct counts of tickets for a specific date.  

thank you for your response! 

You are welcome.


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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.