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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
heatherforman
Frequent Visitor

Calculate # of instances of specific value in a column

Hi!
I apologize for asking a question that has been asked before, but none of the solutions I can find are working for me?!?
I have a table in which each unique ID is assigned a rating (formatted as text) and a corresponding capacity. I'd like a new column that counts every instance of each rating within the table. Solutions I've tried have either resulted in a FALSE (0) answer, or only counted one of the ratings. I'd like to then calculated the combined capacity for everyone in that rating.
Thank you!

CURRENT

Rating

Capacity

U

0

9

175000

9

175000

9

175000

9

175000

U

0

CW

50000

9

175000

 

DESIRED RESULT

Rating

Capacity

Count of Rating

Count of Capacity per Rating

U

0

2

0

9

175000

5

875000

9

175000

5

875000

9

175000

5

875000

9

175000

5

875000

U

0

2

0

CW

50000

1

50000

9

175000

5

875000

1 ACCEPTED SOLUTION
techies
Super User
Super User

Hi @heatherforman no worries, please check this calculated columns

 

RatingCount =
VAR CurrentRating = 'Table'[rating]
RETURN
COUNTROWS(FILTER('Table', 'Table'[rating] = CurrentRating))
 
TotalCapacityByRating =
VAR CurrentRating = 'Table'[rating]
RETURN
CALCULATE(SUM('Table'[capacity]), ALLEXCEPT('Table', 'Table'[rating]))
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

View solution in original post

2 REPLIES 2
techies
Super User
Super User

Hi @heatherforman no worries, please check this calculated columns

 

RatingCount =
VAR CurrentRating = 'Table'[rating]
RETURN
COUNTROWS(FILTER('Table', 'Table'[rating] = CurrentRating))
 
TotalCapacityByRating =
VAR CurrentRating = 'Table'[rating]
RETURN
CALCULATE(SUM('Table'[capacity]), ALLEXCEPT('Table', 'Table'[rating]))
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

Got it!!!  Sorry, I hadn't entered it properly, it works now! Thank you so much!

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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 Kudoed Authors