Forum Discussion
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.
| Name | Code | Type | Price |
| 10G | 72 | S | 10 |
| 11C | 86 | A | 12 |
| 3D | 18 | S | 10 |
| 3D | 18 | B | 5 |
| 3L | 91 | S | 5 |
| 3L | 91 | A | 15 |
| 3L | 91 | C | 10 |
| AB | 58 | S | 15 |
| AB | 58 | A | 15 |
| FC | 38 | S | 40 |
| YM | 74 | S | 20 |
| YM | 74 | C | 20 |
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
| Name | Price |
| 10G | 10 |
| 11C | 12 |
| 3D | 15 |
| 3L | 30 |
| AB | 15 |
| FC | 40 |
| YM | 20 |
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
- johnt75
Super User
Try
Sum of unique values = SUMX ( SUMMARIZE ( 'Table', 'Table'[Name], 'Table'[Price] ), 'Table'[Price] )- AnonymousNot 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 optionThank you- johnt75
Super User
Are you sure you used the right measure in the second table visual, both columns have the same name ?
- AnonymousNot applicable
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
Super User
As long as the tables are related the same technique should work, you can summarize a table including values from a related table