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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors