Forum Discussion
Using both ALL and ALLEXCEPT together?
Hello All,
Simplistic table:
| YEAR | COMPANY | OrderNumber |
[YEAR] is linked to a Calander Table which also has [YEAR]
I have two slicers on the page, YEAR and COMPANY
I am trying to create a measure to count the number of OrderNumbers ignoring the COMPANY but keeping the YEAR
NumberofOrders =
CALCULATE
(
DISTINCTCOUNT('Table'[OrderNumber]),
ALL('Table'),
ALLEXCEPT('Calendar','Calendar'[YEAR])
)
However this doesnt seem to work. Any ideas on how to correct?
Thank you
BugmanJ
Please tryNumberofOrders = CALCULATE ( DISTINCTCOUNT ( 'Table'[OrderNumber] ), ALLEXCEPT ( 'Table', 'Calendar'[Date] ) )
6 Replies
- ValtteriNCommunity Champion
Hi,
Since you want to remove one filter and keep the other try using REMOVEFILTER:
DAX:Measure 39 = CALCULATE(DISTINCTCOUNT('Table (25)'[OrderNumber]),REMOVEFILTERS('Table (25)'[Company]))
End result:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/ - BugmanJHelper V
- BugmanJHelper V
tamerj1 / ValtteriN
Slight variance on the above. In the Data above, lets say I have an extra coloumn called [TIMETOPRODUCE] but I want that to filter out orders less then 155NumberofOrders = CALCULATE ( DISTINCTCOUNT ( 'Table'[OrderNumber] ), ALLEXCEPT ( 'Table', 'Calendar'[Date] ), FILTER ( 'Table'[TimeToProduce]<155) )
Doesnt work, any ideas?
J