Forum Discussion

shaunguyver's avatar
shaunguyver
Icon for Helper III rankHelper III
7 years ago
Solved

Count number of dates between two dates

I have a table with a single column (date), which has a series of dates under it.

 

I need to create a measure that counts the number of dates that falls in 2018.

 

Any idea how I can do this?

 

Thanks

  • shaunguyver

     

    Hi, lets try with this:

     

    Datesin2018 = COUNTROWS(FILTER(Table1,YEAR(Table1[Fecha])=2018))

    Regards

     

    Victor

     

3 Replies

  • Vvelarde's avatar
    Vvelarde
    Icon for Community Champion rankCommunity Champion

    shaunguyver

     

    Hi, lets try with this:

     

    Datesin2018 = COUNTROWS(FILTER(Table1,YEAR(Table1[Fecha])=2018))

    Regards

     

    Victor

     

    • shaunguyver's avatar
      shaunguyver
      Icon for Helper III rankHelper III
      This works! Thank you. For some reason I can't accept this as a solution, but please accept this as confirmation that it is - thanks again
  • v-chuncz-msft's avatar
    v-chuncz-msft
    Icon for Community Support rankCommunity Support

    shaunguyver,

     

    You may also try the DAX below.

    Measure =
    CALCULATE ( COUNT ( Table1[date] ), Table1[date].[Year] = 2018 )