Forum Discussion
DAX ALLEXCEPT function with RELATED table columns as filters
Hi All,
I am trying to calculate the distinct count of a field "Visits" but only need it to be filtreable by a "Date" field from another table.
I used the ALLEXCEPT funtion but the filter and formula only work when the "Date" field from the same table, when I use the "Date" field from the "Date" table, it doesn't work.
Same Table Formula:
Total visits = CALCULATE( DISTINCTCOUNT(Visits[Visits: Visits Id]),
Thanks,
9 Replies
- v-yanjiang-msftCommunity Support
Hi benabdillahr ,
According to your description, here's my solution.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- smpa01Community Champion
benabdillahr can you test out if this works for you
CALCULATE( DISTINCTCOUNT(Visits[Visits: Visits Id]),
ALL('Date'),VALUES('Date'[Date]))- benabdillahrFrequent Visitor
Thank you smpa01 for you response!
I tried your formula, the date filter from the related table is now working but it calculates the distinct count of visits by category. I want my measure to ignore the categories in order to have the same value "243" repeated for each category since I'm using it as a denominator for another measure.Thanks!
- smpa01Community Champion
benabdillahr may be try this
CALCULATE( DISTINCTCOUNT(Visits[Visits: Visits Id]), ALL('Date'),VALUES('Date'[Date]), ALL(Visits[Category]))replicated on a small scale, pbix is attached
- benabdillahrFrequent Visitor
Unfortunately, I get the same result ☹️
- smpa01Community Champion
benabdillahr please provide a sample pbix representative of the issue