Forum Discussion

sshiny's avatar
sshiny
Helper II
4 years ago
Solved

Finding count

Unable to find the count of tsg id with respect to the tsg owner

 

"Total procedure completed" column should calculate how m

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi sshiny ,

     

    I suggest you to create a calculated column by code as below.

    Count of tags with respect to the unique tag owner =
    VAR _Tag_Owner_List =
        CALCULATETABLE (
            VALUES ( 'Table'[TAG_OWNER] ),
            ALLEXCEPT ( 'Table', 'Table'[Tag Id] )
        )
    VAR _COUNT_OF_LIST =
        COUNTAX ( _Tag_Owner_List, [TAG_OWNER] )
    RETURN
        IF ( _COUNT_OF_LIST = 1, 1, BLANK () )

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

     

     

     

4 Replies

  • NickolajJessen I am trying to find the count of tags with respect to the unique tag owner.

    My DATA-

    I need a third column that gives the value of the count of tags for tag owner "A" and the value of the count of tags for tag owner "B" 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi sshiny ,

       

      I suggest you to create a calculated column by code as below.

      Count of tags with respect to the unique tag owner =
      VAR _Tag_Owner_List =
          CALCULATETABLE (
              VALUES ( 'Table'[TAG_OWNER] ),
              ALLEXCEPT ( 'Table', 'Table'[Tag Id] )
          )
      VAR _COUNT_OF_LIST =
          COUNTAX ( _Tag_Owner_List, [TAG_OWNER] )
      RETURN
          IF ( _COUNT_OF_LIST = 1, 1, BLANK () )

      Result is as below.

       

      Best Regards,
      Rico Zhou

       

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

       

       

       

  • sshiny Try this Measure:

    MEASURE = CALCULATE(COUNT(Table[Tag ID]),ALLEXCEPT(TableName,Table[Tag Owner]))