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
Anonymous
Not applicable

Count by plan

Hi Team,

 

I am having table with two fileds : 

NamePlanid
A1
A2
B1
c1
c2
c3

 

 

Need to calculate count in measure like below screen shot

NamePlanidCount
A12
A22
B11
c13
c23
c33
4 REPLIES 4
VahidDM
Super User
Super User

Hi @Anonymous 

 

Try this measure:

Count =
CALCULATE ( COUNT ( 'Table'[Name] ), ALL ( 'Table'[Planid] ) )

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos ✌️!!

Anonymous
Not applicable

@VahidDM 

 

This is giving count of names but i need count of distinct planid for each name like below (Count column is expected)

NamePlanidCount
A12
A22
B11
c12
c22
c22

Hi @Anonymous 

 

Try this measure:

 

Count = 
CALCULATE ( DISTINCTCOUNT( 'Table'[Planid] ), ALLEXCEPT( 'Table','Table'[Name]))

 

Output:

VahidDM_0-1631180485311.png

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos✌️!!

Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

Try this measure:

Count= CALCULATE(COUNT(Table[Name]), ALL(Table[Planid]))

 

Thanks

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.