Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

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 won't work. Any one an idea what i should use instead?

annuleringen 2021 = CALCULATE( COUNTROWS(ALL(Sheet0[reden voor annulering] where YEAR ( Sheet0[datum verwijsbrief] ) = 2021)))

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

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.


View solution in original post

v-jingzhang
Community Support
Community Support

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.

vjingzhang_0-1647510638753.png

 

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. 

vjingzhang_1-1647510858465.png

 

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

View solution in original post

4 REPLIES 4
v-jingzhang
Community Support
Community Support

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.

vjingzhang_0-1647510638753.png

 

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. 

vjingzhang_1-1647510858465.png

 

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

Anonymous
Not applicable

Hans_Delwel_0-1647261952476.png

 

Anonymous
Not applicable

This way it counts all the rows, i want only to count the rows in column Sheet0[reden voor annulering] idf this is filled with an tekst value (this tekst are different reasons)

Anonymous
Not applicable

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.


Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.