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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
leekep88
Frequent Visitor

Count based on a date in another table

I feel like this should be a simple equation, but I am new to Power BI and am still learning DAX. I have read other solutions on similar questions, but I can't get anything to work in my table. My 'Raw Data' table has ticket data with Pay Period references, Created Dates and Closed Dates. I have another reference table 'Pay Periods' which just has all of the Pay Periods with the associated Start and Stop Dates, as well as a Back Log Date which is just 12 weeks prior to the start date.

 

I am building a Matrix that has all of the Pay Periods with counts of actions created, closed, etc. The column that I am having difficulty with is the Back Log column. All I want to do is count the number of actions that have a 'Raw Data' [Create Date] that is earlier than 'Pay Period'[Back Log Date]. When I use the filter function, it won't let me reference two different tables. I've been stuck on this for two weeks, please help.

2 REPLIES 2
amitchandak
Super User
Super User

@leekep88 , Check if you are looking for active employee kind of measure

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

file are attached after signature

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

I tried an iteration of it, but it returned blanks in all of the columns. I don't really understand the logic of it enough to translate it to my situation. 

 

Back Log = CALCULATE(COUNTX(FILTER('Raw Data','Raw Data'[CREATEDATE]<=max('Pay Period'[Back Log Date])),'Raw Data'[PP CREATE]),CROSSFILTER('Raw Data'[CREATEDATE],'Pay Period'[Back Log Date],None))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.