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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Dnssdrs
Microsoft Employee
Microsoft Employee

COUNTROWS using date problem

I’m trying to create a weekly trend that tracks my job’s issue tickets — specifically the ‘Created Ticket’ and ‘Closed Ticket’ for that week.
I’ve successfully created a measure for the ‘Created Ticket’, but I’m unable to use the same formula to create the ‘Closed Ticket’ measure.

For background, I have two tables: the First is my calendar table, and the Second contains issue titles, details, created dates, and closed dates for the tickets.
I’ve created a relationship (One-to-Many) from the first table’s ‘Date’ column to the second table’s ‘Created Ticket’ column.

Here’s what my trend looks like right now:

Dnssdrs_0-1760592812894.png

The ‘Closed Issue’ trend is displayed incorrectly; it should show a higher value and on the most X-axis.

Does anyone have any suggestions?

2 ACCEPTED SOLUTIONS
BeaBF
Super User
Super User

@Dnssdrs Hi!

Which are your measures? Have you tried with:

Closed Tickets =
CALCULATE(
COUNTROWS(Tickets),
USERELATIONSHIP(Calendar[Date], Tickets[Closed Date])
)

 

You can also try with:

Closed Tickets =
COUNTROWS(
FILTER(
Tickets,
Tickets[Closed Date] >= MIN(Calendar[Date]) &&
Tickets[Closed Date] <= MAX(Calendar[Date])
)
)

 

BBF


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

👍 Kudos are appreciated

🔥 Proud to be a Super User!

Community News image 1920X1080.png

View solution in original post

Kedar_Pande
Super User
Super User

Your relationship is wrong. You linked Calendar to Created Date, but Closed Date needs its own relationship.

Create an inactive relationship from Calendar[Date] to your tickets table[Closed Date]. Then use this measure:

 

Closed Tickets =
CALCULATE(
COUNTROWS(Tickets),
USERELATIONSHIP(Calendar[Date], Tickets[Closed Date])
)

 

Use this measure in your trend line.

 

 

If this answer helped, please click Kudos or mark as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande

View solution in original post

2 REPLIES 2
Kedar_Pande
Super User
Super User

Your relationship is wrong. You linked Calendar to Created Date, but Closed Date needs its own relationship.

Create an inactive relationship from Calendar[Date] to your tickets table[Closed Date]. Then use this measure:

 

Closed Tickets =
CALCULATE(
COUNTROWS(Tickets),
USERELATIONSHIP(Calendar[Date], Tickets[Closed Date])
)

 

Use this measure in your trend line.

 

 

If this answer helped, please click Kudos or mark as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande

BeaBF
Super User
Super User

@Dnssdrs Hi!

Which are your measures? Have you tried with:

Closed Tickets =
CALCULATE(
COUNTROWS(Tickets),
USERELATIONSHIP(Calendar[Date], Tickets[Closed Date])
)

 

You can also try with:

Closed Tickets =
COUNTROWS(
FILTER(
Tickets,
Tickets[Closed Date] >= MIN(Calendar[Date]) &&
Tickets[Closed Date] <= MAX(Calendar[Date])
)
)

 

BBF


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

👍 Kudos are appreciated

🔥 Proud to be a Super User!

Community News image 1920X1080.png

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.