Forum Discussion
Anonymous
6 years agoNot applicable
Edit DAX to filter out specifics dates from column
Hi, I have some DAX that is filtering out weekends. But I also need it to filter out specifcs company holidays. He is the DAX i'm currently using. I need the dates removed from the date column. ...
- 6 years ago
Sorry, you need a SELECTCOLUMNS in there:
dim date = EXCEPT( SELECTCOLUMNS( FILTER ( ADDCOLUMNS ( CALENDAR ( DATE ( 2020, 1, 1 ), DATE ( 2020, 12, 31 ) ), "WeekDay", WEEKDAY ( [Date], 2 ) ), [WeekDay] <= 5 ), "Date",[Date] ), ALL('Holidays',[Date]) )
Anonymous
6 years agoNot applicable
Hi Greg_Deckler,
Thanks for replying. I do have a holidays table. And whenever I try to add anything to that existing dax it breaks it. Where within that dax would I put EXCEPT?
Thanks for replying. I do have a holidays table. And whenever I try to add anything to that existing dax it breaks it. Where within that dax would I put EXCEPT?
Greg_Deckler
Community Champion
6 years agoShould be something along the lines of:
dim date =
EXCEPT(
FILTER (
ADDCOLUMNS (
CALENDAR ( DATE ( 2020, 1, 1 ), DATE ( 2020, 12, 31 ) ),
"WeekDay", WEEKDAY ( [Date], 2 )
),
[WeekDay] <= 5
),
ALL('Holidays',[Date])
)- Anonymous6 years agoNot applicable
Hi Greg_Deckler ,
Thanks for reaching out so quickly. Looks like I'm still having an issue.Here are some screen shots of what's going on. I'm a bit confused. I tried two different ways. I hvae included a screen shot of the holiday table. Maybe the dim date table isn't right or something.
- Greg_Deckler6 years ago
Community Champion
Anonymous my bad, it should be ALL('Holidays'[Date])
- Anonymous6 years agoNot applicable
Greg_DecklerI did that example in the first picture I sent and got an error.