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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
nic88
Frequent Visitor

Count of a value

Hi, I'm having an issue with a measure I'm trying to write.

 

I have a table with a partner name as a row and sub rows for different benefits associated with that partner. The column 'plan count' is a measure. I want to add another column 'count of plan benefits' which is the sum of all of the counts for that partner. In the screenshot, I am looking for the 2342 value to be in the green cells. I will then use this after to create a percent weighting. 

 

The current formula for 'count of plan benefits' is:

Count of Plan benefits = CALCULATE(
    COUNT(Benefits[Partner]),
    ALLSELECTED(Benefits[Partner])
)
 
But this isn't doing what I want. 
 
Basically, I want to ignore the individual benefits filter and get the count for the partner which Powerbi sums in yellow and display that in the green cells. 
 
Screenshot 2023-02-08 204436.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@nic88 , Try like

 

Count of Plan benefits = CALCULATE(
COUNT(Benefits[Partner]),
filter( ALLSELECTED(Benefits),Benefits[Partner] = max(Benefits[Partner]))
)

 

Or use removefilters for the level having value Risk Advisor etc

 

Count of Plan benefits = CALCULATE(
COUNT(Benefits[Partner]),removefilters (Benefits[Level 2]) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@nic88 , Try like

 

Count of Plan benefits = CALCULATE(
COUNT(Benefits[Partner]),
filter( ALLSELECTED(Benefits),Benefits[Partner] = max(Benefits[Partner]))
)

 

Or use removefilters for the level having value Risk Advisor etc

 

Count of Plan benefits = CALCULATE(
COUNT(Benefits[Partner]),removefilters (Benefits[Level 2]) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I used the second solution and it worked! Thank you!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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 Solution Authors
Top Kudoed Authors