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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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