Forum Discussion

AB1977's avatar
AB1977
Regular Visitor
9 years ago
Solved

Unique Sum DAX

Kia ora   The picture below is a snippet of my data set. I want to be able to sum the second column based on the data in the first. I want to sum column 2 for each of the unique sets of dat...
  • vcastello's avatar
    9 years ago

    Hi AB1977,

     

    Assuming your dataset has a table named "Table1" which first column is named "Column1" and second column is named "Column2" ...

    1.- Create a new measure called "Total Column2" with the following DAX code: SUM(Table1[Column2]). 
    2.- Create a new measure called "Total Column1" with the following DAX code: COUNTA(Table1[Column1]).
    3.- Create a new measure called "Total" with the following DAX code: DIVIDE([Total Column2];[Total Column1]).

    4.- Create a new visual (table) with Column1 (ID) on rows and each of the measures you've created on columns

    That should work

     

    Vicente