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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
fsim
Responsive Resident
Responsive Resident

yet another allexcept question

hi !

I  wanted to get the first TimeSheet date encoded by every employee.

mindate = CALCULATE(MIN((TS[msdyn_date])), ALLEXCEPT(TS,TS[msdyn_bookableresource]))
this work perfectly.
then I also wanted to keep a calendar filter.  So I added TS[msdyn_date] to the ALLEXCEPT -->
mindate = CALCULATE(MIN((TS[msdyn_date])), ALLEXCEPT(TS,TS[msdyn_bookableresource],TS[msdyn_date]))
I expected that any filter applied to the Date table would affect my mindate. It doesn't. 
The Calendar table is linked to the msdyn_date and I put a slicer on it.
Screenshot 2021-05-19 113345.png
 
deit: I tried something else : 
mindate = CALCULATE(MIN((TS[msdyn_date])), ALLEXCEPT(TS,TS[msdyn_bookableresource], 'Date'[YearMonthShort]))
this worked, but I cannot accept that solution because the slicer will not be the only way to filter dates 😕
 
1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @fsim 

ALLEXCEPT can take a mixture of column & table references for arguments 2+.

So you could write this to ensure any filters from the 'Date' table are retained:

 

mindate =
CALCULATE (
    MIN ( TS[msdyn_date] ),
    ALLEXCEPT ( TS, TS[msdyn_bookableresource], 'Date' )
)

 

 Does this achieve the result you are wanting?

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @fsim 

ALLEXCEPT can take a mixture of column & table references for arguments 2+.

So you could write this to ensure any filters from the 'Date' table are retained:

 

mindate =
CALCULATE (
    MIN ( TS[msdyn_date] ),
    ALLEXCEPT ( TS, TS[msdyn_bookableresource], 'Date' )
)

 

 Does this achieve the result you are wanting?

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn
fsim
Responsive Resident
Responsive Resident

@OwenAuger , 

it worked.
I don't know why I wanted to add a column instead of a full table. Thank you !

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors