Forum Discussion

nabilhas's avatar
nabilhas
Regular Visitor
9 years ago

count rows with date that's within last two weeks

I have a table that contains warehouse locations and a "last verified date".  I would like to count locations that were verified during the last two weeks from today.  

 

 

 

 

Thanks for your help,

NH

1 Reply

  • malagari's avatar
    malagari
    Icon for Continued Contributor rankContinued Contributor

    You can do something like this:

     

    CALCULATE( 
    COUNTROWS( Table ), FILTER(Table, DATEDIFF(Table[Last Verif Date], TODAY(), DAY) <= 14) )

     

    The FILTER argument filters down to rows whose [Last Verif Date] is within 14 days of today.  You may want to change it to less than instead of less than or equal to, depending on your logic.