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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Count rows in unrelated table based on date

HI together,

 

I have a problem that has been making me despair for days.

Actual description:
Currently there are two tables. The first table contains all incidents with the attributes ID, ActualStart, ActualFinish. This table is with the Date table where all dates are located. Both tables are connected by Date and Actual Start.

 

Two KPI are needed:
One is to count how many tickets were opened in the month, which turns out to be pretty simple.
DAX: Created_Tickets = COUNTROWS(RELATEDTABLE(Security_Incidents_Created))

 

The second number is a bit harder to calculate and makes me despair.
Due to the fact that the connection between ActualStart and Date was drawn, I can't manage to count the rows where Closed Month is equal to Date.
Keyword: Countrows to an unrelated table.
The attempt to solve this with a variable failed.

Closed_Ticket = var cont = FIRSTNONBLANK('Security_Incidents_Created'[Closed Month],1) return COUNTROWS(FILTER('Date','Date'[Date]=cont))

In addition, tickets can still be open if Closed Month is empty.

 

Could somebody please help?

jannisb_1-1633084007450.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Seem like very similar to my HR blog topic

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Seem like very similar to my HR blog topic

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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