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
Anonymous
Not applicable

Counting Occurrences of a Rule in a Measure

Hello,

 

I am attempting to create a measure that counts the number of distributors who have met their goal. Fields considered: Distributor Name (Columns), Progression to Goal (% Measure)

 

For each time Progression to Goal is >= 1, add 1 to a counter. Then, return total counter.

 

At the end of the day, I want a KPI card that shows: x distributors have achieved their goal.

 

Seems simple, yet here I am haha.

 

Thanks,

Joel

 

 

5 REPLIES 5
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

According to your description, I create a sample.

vkalyjmsft_0-1654675847520.png

Here's my solution, create a measure.

Count =
COUNTROWS (
    FILTER ( 'Table', 'Table'[progression_to_annual_target_annualized] >= 1 )
)

Get the correct result.

vkalyjmsft_1-1654675904065.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

Anonymous
Not applicable

That would work, but 

[progression_to_annual_target_annualized]

is a measure. As a result, I am being thrown an error:

jfeddes_0-1654698038107.png

Any ideas?

Hi @Anonymous ,

According to the error message, by my research, it's usually a data type error.

As for now, need more data information to dig.

Best Regards,
Community Support Team _ kalyj

VahidDM
Super User
Super User

Hi @Anonymous 

 

Can you share a sample of your data here in a text format or add more data to your question? 
BTW, you can try a measure like this:

Measure = 
Var _A = CALCULATETABLE(VALUES('Table'[Distributor]),filter('Table',[Progression to Goal]>1))
return
COUNTROWS(_A)

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 FIFA World Cup - Medal Records 

Anonymous
Not applicable

Hey @VahidDM ,

 

My data looks like this:

jfeddes_3-1654266074457.png

I tried the measure you proposed:

conversions_hit_target_counter = 
Var _counter = CALCULATETABLE(VALUES('conversion_data'[conversion_opportunity_id]),filter('conversion_data',[progression_to_annual_target_annualized]>=1))
return
COUNTROWS(_counter)

but am getting an error:

jfeddes_2-1654266005170.png

 

End game, I want a card to spit out the counter. In this case, 1 would be the return value due to only one conversion meeting thr 100% criteria.

 

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.