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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.