cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Slicer and ALLEXEPT

Hi!

 

This measure runs perfectly until I use a slicer with values from another table - 'Departments' . How do I write the dax so that the measure not ignore the slicer? 

 

Income per client = 
            CALCULATE(
                SUMX('Table';
                [Income]);
                     ALLEXCEPT('Table';
'Table'[Clientnumber]); FILTER( ALLSELECTED('Calendar'[Date]); 'Calendar'[Date]<=MAX('Calendar'[Date]) && MAX('Calendar'[Date]) <= TODAY()) )

 

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

@Anonymous 

Thankfully, you can provide ALLEXCEPT with a mixture of tables and columns for which to retain filters.

 

So you can write a measure like this to retain filters on any columns of the Departments table:

Income per client =
CALCULATE (
    SUMX ( 'Table'; [Income] );
    ALLEXCEPT ( 'Table'; 'Table'[Clientnumber]; Departments );
    FILTER (
        ALLSELECTED ( 'Calendar'[Date] );
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
            && MAX ( 'Calendar'[Date] ) <= TODAY ()
    )
)

Regards,

Owen


Owen Auger

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

My Blog
Connect on Twitter
Connect on LinkedIn

View solution in original post

1 REPLY 1
OwenAuger
Super User
Super User

@Anonymous 

Thankfully, you can provide ALLEXCEPT with a mixture of tables and columns for which to retain filters.

 

So you can write a measure like this to retain filters on any columns of the Departments table:

Income per client =
CALCULATE (
    SUMX ( 'Table'; [Income] );
    ALLEXCEPT ( 'Table'; 'Table'[Clientnumber]; Departments );
    FILTER (
        ALLSELECTED ( 'Calendar'[Date] );
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
            && MAX ( 'Calendar'[Date] ) <= TODAY ()
    )
)

Regards,

Owen


Owen Auger

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

My Blog
Connect on Twitter
Connect on LinkedIn

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.