Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Filter a table by date using DAX

Hello, How can I filter a table for a date field using DAX? I have a date range to filter. The output would be a second table. Thank you!
  • jdbuchanan71's avatar
    7 years ago

    Hello Anonymous 

    Give this a try, you will just need to change the table and column names to match your data.

    Filtered Sales = 
    CALCULATETABLE(
        Sales,
        DATESBETWEEN ( Sales[Sales Date], DATE(2019,1,15), DATE(2019,2,5) )
    )

    This creates a new table called 'Filtered Sales' that is the Sales table filtered to 1/15/2019 - 2/5/2019