Forum Discussion

estt's avatar
estt
Frequent Visitor
3 years ago
Solved

Column with sum of distinct values

Hello, i need help to make a column that sum the numbers in the column tp_kmro, based on the column id_pref. In the column id_pref i have the id and this id repeats lots of times ex:

 

id_preftp_kmro
12
12
12
24
24
35

 

i made a column based on id_pref with distinct values so the new id_pref is now:

1
2
3

 

Now i need to make a new column tp_kmro with the sum of all values in this column

example: sum all values in tp_kmro and put next to id_pref .

 

like this:

id_preftp_kmro
16 (2+2+2)
28 (4+4)
35 (5)

 

Can someone help with this please?

4 Replies

  • estt 

    Create the below measure and use it in a Table Visual along with your id_pref column

    Total = sum(tablename[tp_kmro])

    • estt's avatar
      estt
      Frequent Visitor

      It worked man thanks, but i need to make this column in power query.

      • Fowmy's avatar
        Fowmy
        Icon for Super User rankSuper User

        estt 

        Right click on the id_pref, select Group By