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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MadhuriReddy
New Member

Count of Occurrences of a measure

In PowerBI, I am trying to figure out how to perform a count of stores based upon the percentage groups

 

PCNT_Measure = DIVIDE(SUM('Table'[Visit]), SUM('Table'[Schedule]))
 

MadhuriReddy_1-1680257763352.png

For example, if all 4 months are selected

The desired result would be:
100% = 3 stores
75% = 1 store
50% = 2 stores

MadhuriReddy_2-1680257790352.png

This count/percentage would then change if different months were selected.

For example, if only months 1 through 3 were selected...
...then the count would be:

100% = 3 stores
66.7% = 3 stores

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @MadhuriReddy 

 

You can use the following measure. This measure works when adding it to a visual which has [Store] column. If the visual doesn't have the [Store] column, the variable _pcnt cannot get the correct result then COUNTROWS would probably return a blank result.  

Count_PCNT = 
var _t = SUMMARIZE(ALLSELECTED('Table'),'Table'[Store],"PCNT",[PCNT_Measure])
var _pcnt = [PCNT_Measure]
return
COUNTROWS(FILTER(_t,[PCNT]=_pcnt))

vjingzhang_0-1680488588832.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @MadhuriReddy 

 

You can use the following measure. This measure works when adding it to a visual which has [Store] column. If the visual doesn't have the [Store] column, the variable _pcnt cannot get the correct result then COUNTROWS would probably return a blank result.  

Count_PCNT = 
var _t = SUMMARIZE(ALLSELECTED('Table'),'Table'[Store],"PCNT",[PCNT_Measure])
var _pcnt = [PCNT_Measure]
return
COUNTROWS(FILTER(_t,[PCNT]=_pcnt))

vjingzhang_0-1680488588832.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Thank you @v-jingzhang 

MadhuriReddy
New Member

Sample Data

StoreMonthScheduleVisit
Store #012022_0111
Store #012022_0211
Store #012022_0311
Store #012022_0411
Store #022022_0111
Store #022022_021 
Store #022022_0311
Store #022022_0411
Store #032022_0111
Store #032022_0211
Store #032022_031 
Store #032022_041 
Store #042022_0111
Store #042022_0211
Store #042022_0311
Store #042022_0411
Store #052022_0111
Store #052022_0211
Store #052022_0311
Store #052022_0411
Store #062022_011 
Store #062022_0211
Store #062022_0311
Store #062022_041 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.