Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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.   ...
  • Greg_Deckler's avatar
    Greg_Deckler
    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])
    )