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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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