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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
timward10
Helper II
Helper II

Count formula

Hi, 

 

I want to count the number of times a field has a number entered, from January to Dec. In excel, I would just use a count formula and reference the columns, what should I use within PBI? 

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @timward10 ,

 

Firstly make sure the data type of your columns is whole number.

Then you can create a Table visualization and add columns you need with Count Function.

Power BI will show blank if there is no data. 

vrzhoumsft_0-1739427661642.png

If you want to show 0 instead of blank, you need to create 12 measures due to your data model.

The measures are similar, they look like as below.

Count Number Jan 25 = CALCULATE(COUNT('Table'[Total Rev Jan 25]))+0

...

Result is as below.

vrzhoumsft_1-1739428511375.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

4 REPLIES 4
bhanu_gautam
Super User
Super User

@timward10 , Use this

CountNumbers = COUNTROWS(
FILTER(
YourTable,
ISNUMBER(YourTable[YourField]) &&
YourTable[DateColumn] >= DATE(Year, 1, 1) &&
YourTable[DateColumn] <= DATE(Year, 12, 31)
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






timward10_0-1739377504265.png

 

Table is attached, I would expect to see all of them columns return zero, apart from the ones that have numbers in, they would return one and so on. 

 

What fields are you referencing in your formula? 

 

Thanks 

Anonymous
Not applicable

Hi @timward10 ,

 

Firstly make sure the data type of your columns is whole number.

Then you can create a Table visualization and add columns you need with Count Function.

Power BI will show blank if there is no data. 

vrzhoumsft_0-1739427661642.png

If you want to show 0 instead of blank, you need to create 12 measures due to your data model.

The measures are similar, they look like as below.

Count Number Jan 25 = CALCULATE(COUNT('Table'[Total Rev Jan 25]))+0

...

Result is as below.

vrzhoumsft_1-1739428511375.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Perfect @Anonymous! It was just the formula I was looking for, if I add the columns together this works how I need it to! Thank you! 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.