Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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 ...
  • tamerj1's avatar
    tamerj1
    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] )
        )
    )