There are multiple ways to do this, but they'll all use some sort of filtering.
Here are a couple examples:
CountIf =
COUNTROWS (
FILTER (
ALL ( Table1 ),
Table1[open_date] <= MAX ( Table1[Date] ) &&
Table1[close_date] >= MAX ( Table1[Date] )
)
)
and
CountIf =
VAR CurrentDate =
MAX ( Table1[Date] )
RETURN
CALCULATE (
COUNT ( Table1[Date] ),
ALL ( Table1 ),
Table1[open_date] <= CurrentDate,
Table1[close_date] >= CurrentDate
)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…