Forum Discussion

Gacek014's avatar
Gacek014
Frequent Visitor
3 years ago

Duplicated values in visualised table

I made a visualisation of a table which is related to other table, now I want to create a column in this visualisation with information how many times same name is mentioned in this table. Table can be filtered by Fragmentator. I know that I need to create a measure but I'm not sure how it should look like.

6 Replies

  • StuartSmith's avatar
    StuartSmith
    Power Participant

    Try something like this.  This counts how many "John Doe"'s are in the Backfill Column.

     

    test = CALCULATE(COUNTROWS('Absence Master Record'), FILTER('Absence Master Record', 'Absence Master Record'[Backfill] = "John Doe"))
     
  • Gacek014's avatar
    Gacek014
    Frequent Visitor

    Thanks but I want to have this info in the last column. So I have table like this:

    A B C D

    x a q 

    x s q

    x d q

    c f q

    v g q

    And I want to know in column D that x in column A is visible 3 times and c and v only onces.

     

    A B C D

    x a q 3 

    x s q 3

    x d q 3

    c f q 1

    v g q 1

    • StuartSmith's avatar
      StuartSmith
      Power Participant

      So, something like this... 

      Calculated Column

      Test 3 = COUNTX (
          FILTER ( 'Absence Master Record', EARLIER ( 'Absence Master Record'[Backfill] ) = 'Absence Master Record'[Backfill] ),
          'Absence Master Record'[Backfill]
      )
      • Gacek014's avatar
        Gacek014
        Frequent Visitor

        Both answers gave me the same results, but I have relation with other table. Relation is set on column B and filtering is done partialy on the second table and partialy on the first one (From second table i take disivion and from the first one name). Now if I add Calculated column or measure, it is not updated by filters available but it is linked to raw data from table 1.

    • mlsx4's avatar
      mlsx4
      Memorable Member

      Hi Gacek014 

       

      Use this:

      Medida = CALCULATE(COUNTROWS(MyTable),ALLEXCEPT(MyTable,MyTable[A]))