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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Hickling
Helper I
Helper I

Count open items each day, 2 date columns

Hi team,

 

I have a date table, and a data table, the three relevant columns from the data table are:

 

IDDate IssuedCompliance Date
11/01/202010/01/2020
25/01/202014/01/2020
313/01/202020/01/2020
416/01/202022/01/2020

 

I need 3 measures, 2 I've done, stuck on the third. My date table has an active relationship between Date and Date Issued, and an inactive relationship between Date and Compliance Date.

 

For the first measure, items raised on a given day, it's just a distinctcount of the id

 

For the second measure, items closed on a given day, it's

CALCULATE([Raised], USERELATIONSHIP('Calendar'[Date],'Data Table'[Compliance Date]))
 
The third measure, I need to be able to show how many were open on any given day. So where Date Issued is <= 'Calendar'[Date], and Compliance Date is > 'Calendar'[Date] || Blank. 
 
Edit: Sorry I should add that I'm trying to avoid doing this in another table like I usually would, because the visual output for this measure will require using a slicer and/or legend for other columns in the data table
1 ACCEPTED SOLUTION
swikritee_p
Resolver II
Resolver II

@Hickling , You can try a measure like one used in HR Analytics 

CALCULATE(COUNTx(FILTER(Employee,Employee[Start Date]<=max('Date'[Date]) && (ISBLANK(Employee[End Date]) || Employee[End Date]>max('Date'[Date]))),(Employee[Employee Id ])),CROSSFILTER(Employee[Start Date],'Date'[Date],None))

You can refer this blog

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

View solution in original post

2 REPLIES 2
swikritee_p
Resolver II
Resolver II

@Hickling , You can try a measure like one used in HR Analytics 

CALCULATE(COUNTx(FILTER(Employee,Employee[Start Date]<=max('Date'[Date]) && (ISBLANK(Employee[End Date]) || Employee[End Date]>max('Date'[Date]))),(Employee[Employee Id ])),CROSSFILTER(Employee[Start Date],'Date'[Date],None))

You can refer this blog

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

This is perfect, thank you!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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