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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.