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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
afarbod
Frequent Visitor

need help to write a formula to count a specific number that is repeated and showing up in a column

I have a table that looks like this, below, the column ORder shows numbers.  What I am interested in is to write a formula to look in the Order column and count the number of times the number "4" appears.   

CustomerDescriptionOrder
ALogs pulled7
BPartial logs4
C Partial at 8- %4
dNo Logs3
3 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @afarbod 

Try a measure :

count_4 = CALCULATE(COUNTROWS('Table'),'Table'[Order]=4)
Ritaf1983_0-1702310549300.png

pbix is attached 

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

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Thank you so much for your quick response.   for some reason, I keep getting 1 for the result, not sure if that has something to do with my table below

afarbod_0-1702316198397.png

my formula  : 

return new account value = CALCULATE(COUNTROWS('Table_enumLogStatus'), Table_enumLogStatus[Order]=4)
I keep getting 
afarbod_1-1702316269970.png

 

 

View solution in original post

Glad to help @afarbod ☺️

please consider Accepting my post as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

5 REPLIES 5
Ritaf1983
Super User
Super User

Hi @afarbod 

Try a measure :

count_4 = CALCULATE(COUNTROWS('Table'),'Table'[Order]=4)
Ritaf1983_0-1702310549300.png

pbix is attached 

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

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thank you so much for your quick response.   for some reason, I keep getting 1 for the result, not sure if that has something to do with my table below

afarbod_0-1702316198397.png

my formula  : 

return new account value = CALCULATE(COUNTROWS('Table_enumLogStatus'), Table_enumLogStatus[Order]=4)
I keep getting 
afarbod_1-1702316269970.png

 

 

Hi @afarbod 
Please share a link to dummy pbix and I'll try to help

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thank you again, I think I figured out what I was doing wrong, I used your formula and worked.   Thank you so much

Glad to help @afarbod ☺️

please consider Accepting my post as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

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.