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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors