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]) )
Greg_Deckler
Community Champion
6 years agoAnonymous my bad, it should be ALL('Holidays'[Date])
Anonymous
6 years agoNot applicable
Greg_DecklerI did that example in the first picture I sent and got an error.
- Greg_Deckler6 years ago
Community Champion
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]) )- Anonymous6 years agoNot applicable
Greg_DecklerGreg, my man! Now that I see it and how it works, it makes sense. Thanks for all you do in the community.
- Greg_Deckler6 years ago
Community Champion
My apologies for all of the syntax errors! That's what happens when I try to write DAX without testing it!!