Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Count rows where year is .....

Hi, Ive got an excel import of orders. One of the collums is called [reden van annulering] I want to count all the rows where the Year value is, for example, 2021.   Tried formula below but this ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous .

    Try this DAX;

    annuleringen 2021 = CALCULATE( COUNTROWS(Sheet0), YEAR ( Sheet0[datum verwijsbrief] ) = 2021)).

    Regards,
    Sanket.

    If this post helps , then mark it as 'Accept as Answer' and give it a thumbs up.


  • v-jingzhang's avatar
    4 years ago

    Hi Anonymous 

     

    It seems you want to count the non-blank rows in [reden voor annulering] column for every year. You can first add a Year column to the table.

     

    Then create the following measure

    Count Measure = CALCULATE(COUNT(Sheet0[reden voor annulering]),Sheet0[reden voor annulering]<>BLANK())

     

    Put Year column and the measure into a table visual, you will get the count for every year. 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.