Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
BugmanJ
Helper V
Helper V

Using both ALL and ALLEXCEPT together?

Hello All,

Simplistic table:

YEARCOMPANYOrderNumber

 

[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

1 ACCEPTED SOLUTION

@BugmanJ 
Please try

 

NumberofOrders =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[OrderNumber] ),
    ALLEXCEPT ( 'Table', 'Calendar'[Date] )
)

 

View solution in original post

6 REPLIES 6
BugmanJ
Helper V
Helper V

Thank you @tamerj1 

BugmanJ
Helper V
Helper 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 155

NumberofOrders =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[OrderNumber] ),
    ALLEXCEPT ( 'Table', 'Calendar'[Date] ),
    FILTER ( 'Table'[TimeToProduce]<155)
)


Doesnt work, any ideas?
J


@BugmanJ 

NumberofOrders =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[OrderNumber] ),
    ALLEXCEPT ( 'Table', 'Calendar'[Date] ),
    'Table'[TimeToProduce] < 155
)
BugmanJ
Helper V
Helper V

@tamerj1  Please see PM

@tamerj1 Original message edited to give more details

@BugmanJ 
Please try

 

NumberofOrders =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[OrderNumber] ),
    ALLEXCEPT ( 'Table', 'Calendar'[Date] )
)

 

ValtteriN
Super User
Super User

Hi,
Since you want to remove one filter and keep the other try using REMOVEFILTER:

ValtteriN_0-1677149925419.png


DAX:

Measure 39 = CALCULATE(DISTINCTCOUNT('Table (25)'[OrderNumber]),REMOVEFILTERS('Table (25)'[Company]))

End result:
ValtteriN_2-1677150133854.png

 


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/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.