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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher 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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.