Forum Discussion
Active relationship causing count to be wrong
- 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] ) ) )
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] )
)
)
Even if I remove the relationships it doesn't count anything 😞
- tamerj14 years agoCommunity Champion
Hi Anonymous
which date column are you using in your visual?
- Anonymous4 years agoNot applicable
Month-Year in the DateQuery table. I have tried with a blank table and it doesn't show anything
- tamerj14 years agoCommunity Champion
Anonymous
I thought you want to slice by this column. I don't understand the meaning of using a blank table. However, please try the follow which I guess should work even in a card visual.
Count of property empty = SUMX ( VALUES ( DateQuery[Month-Year] ), CALCULATE ( COUNTROWS ( FILTER ( hraptvpd, hraptvpd[prev_tency_end] < MIN ( DateQuery[Date] ) && hraptvpd[next_tency_st] > MAX ( DateQuery[Date] ) ) ) ) )