Forum Discussion

Hickling's avatar
Hickling
Icon for Helper I rankHelper I
2 years ago
Solved

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

2 Replies