Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to use DAX Filter function with date filter

i am trying to use DAX filter function to  to create a new column based on  this query, i keep getting a scalar error when i try to create the column. could someone  please give me some guidance on how to create this column?

((xyz = 'CLOSED' or zxy= 'COMP' or xyz = 'CROWNER' or xyz = 'OPSDEFREV' or xyz = 'PEERREVIEW' or xyz= 'WAITINGRER') and orderedate >= TO_TIMESTAMP ('2022-01-01 00:00:00.000' , 'YYYY-MM-DD HH24:MI:SS.FF'))

  • Hi, Anonymous 

    Please add a measure filter like:

    Measure1 =
    IF (
        MAX ( 'Table'[xyz] )
            IN { "ClOSED", "COMP", "CROWNER", "OPSDEFREV", "PEERREVIEW", "WAITINGRER" }
                && MAX ( 'Table'[orderedate] ) >= DATE ( 2022, 01, 01 ),
        1,
        0
    )
    

    Then apply it to table visual filter pane to filter data rows.

    Best Regards,
    Community Support Team _ Eason

     

     

     

1 Reply

  • v-easonf-msft's avatar
    v-easonf-msft
    Community Support

    Hi, Anonymous 

    Please add a measure filter like:

    Measure1 =
    IF (
        MAX ( 'Table'[xyz] )
            IN { "ClOSED", "COMP", "CROWNER", "OPSDEFREV", "PEERREVIEW", "WAITINGRER" }
                && MAX ( 'Table'[orderedate] ) >= DATE ( 2022, 01, 01 ),
        1,
        0
    )
    

    Then apply it to table visual filter pane to filter data rows.

    Best Regards,
    Community Support Team _ Eason