Forum Discussion
Anonymous
4 years agoNot applicable
Active relationship causing count to be wrong
I'm trying to count number of empty propertys by counting the previous tenancy numbers that exist in the empty property table. "hraptvpd" It's worth mentioning that hraptvpd is directly quering the ...
- 4 years ago
Hi Anonymous
first you have to deactivate the active relationship. Or otherwise you need add REMOVEFILTERS ( DateQuery ) with CALCULATE to the following code which considers the property empty only if it is epmty in the whole period.
Count of property empty = COUNTROWS ( FILTER ( hraptvpd, hraptvpd[prev_tency_end] < MIN ( DateQuery[Date] ) && hraptvpd[next_tency_st] > MAX ( DateQuery[Date] ) ) )
Greg_Deckler
4 years agoCommunity Champion
Anonymous Maybe:
Count of property empty =
CALCULATE( COUNT(hraptvpd[prev_tency]),
USERELATIONSHIP(hraptvpd[prev_tency_end], DateQuery[Date]),
DATESBETWEEN(DateQuery[Date], hraptvpd[prev_tency_end], hraptvpd[next_tency_st])
)- Anonymous4 years agoNot applicable