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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
chanon
New Member

How to count rows with conditions from measure

I have a measure DoH derived from creation of Measure ( DoH = Stock / Avg. Usage) 

chanon_0-1661505883498.png

and I want to count Product name at DoH< 10 = ? and  DoH > 100 = ?  

From example  - DoH < 10 = 3

                         - DoH > 100 = 1 

1 ACCEPTED SOLUTION

This is what I'm getting:

DoH = 
DIVIDE(SUM('Table'[Stock]), SUM('Table'[Avg. Usage]))
Less than 10 =
CALCULATE ( COUNT ( 'Table'[Product name] ), FILTER ( 'Table', [DoH] < 10 ) )
More than 100 =
CALCULATE ( COUNT ( 'Table'[Product name] ), FILTER ( 'Table', [DoH] > 100 ) )

result.png





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

5 REPLIES 5
v-henryk-mstf
Community Support
Community Support

Hi @chanon ,

 

Whether the advice given by @PaulDBrown  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Looking forward to your feedback.


Best Regards,
Henry

PaulDBrown
Community Champion
Community Champion

Try:

Less than 10 = 
CALCULATE(COUNT(Table[Product[), FILTER(Table, [DoH] <10))
More than 100 = 
CALCULATE(COUNT(Table[Product[), FILTER(Table, [DoH] >100))




Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thk for reply but didn't work. Due to DoH is Measure when i create count measure then result is 7. 

This is what I'm getting:

DoH = 
DIVIDE(SUM('Table'[Stock]), SUM('Table'[Avg. Usage]))
Less than 10 =
CALCULATE ( COUNT ( 'Table'[Product name] ), FILTER ( 'Table', [DoH] < 10 ) )
More than 100 =
CALCULATE ( COUNT ( 'Table'[Product name] ), FILTER ( 'Table', [DoH] > 100 ) )

result.png





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Arul
Super User
Super User

@chanon ,

please try this,

1. DoH < 10,

count of product DoH < 10 = CALCULATE(COUNT('Table'[Product name]),FILTER('Table',[DOH]<10))

2.DoH >100,

count of product DoH > 100 = CALCULATE(COUNT('Table'[Product name]),FILTER('Table',[DOH]>100))

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors