Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

unique value in measure column

Hi All,

I am trying to get sum of only distinct measure values for a particular Name if the value is repeated.

 

NameCodeTypePrice
10G72S10
11C86A12
3D18S10
3D18B5
3L91S5
3L91A15
3L91C10
AB58S15
AB58A15
FC38S40
YM74S20
YM74C20

 

when I create a view with just name column I want to get the sum aggregated with only unique values.

Expected o/p is as below

 

NamePrice
10G10
11C12
3D15
3L30
AB15
FC40
YM20

 

Can some one please suggest. Thank you all in advance.

  • Try

    Sum of unique values =
    SUMX ( SUMMARIZE ( 'Table', 'Table'[Name], 'Table'[Price] ), 'Table'[Price] )
    

7 Replies

  • Try

    Sum of unique values =
    SUMX ( SUMMARIZE ( 'Table', 'Table'[Name], 'Table'[Price] ), 'Table'[Price] )
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi John,

      Thanks for your inputs tried the suggestion but still the same.

      Also tried below measure nothing seems to work

        SUMX(VALUES('Table'[Price]),'Table'[Price])
      please suggest if we have any other option
      Thank you
      • johnt75's avatar
        johnt75
        Icon for Super User rankSuper User

        Are you sure you used the right measure in the second table visual, both columns have the same name ?

    • Anonymous's avatar
      Anonymous
      Not applicable

      johnt75 

      In my real time data the price column is coming from different table and it is not allowing to call price in the calculation any suggestions please

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

        As long as the tables are related the same technique should work, you can summarize a table including values from a related table