Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

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

  • Tanushree_Kapse's avatar
    Tanushree_Kapse
    Icon for Impactful Individual rankImpactful Individual

    Hi Anonymous ,

     

    Try this measure:

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

     

    Thanks

  • 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's avatar
      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
      • VahidDM's avatar
        VahidDM
        Icon for Super User rankSuper User

        Hi Anonymous 

         

        Try this measure:

         

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

         

        Output:

         

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

        Appreciate your Kudos✌️!!