Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
praveenpasila
Advocate IV
Advocate IV

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.

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

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

View solution in original post

7 REPLIES 7
johnt75
Super User
Super User

Try

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

@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

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

Thanks @johnt75  dont know but initially when I have writted same formula it throwed an error deleted measure and re created and it worked.

Thanks for all your help

Hi John,

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

praveenpasila_0-1683209558558.png

Also tried below measure nothing seems to work

  SUMX(VALUES('Table'[Price]),'Table'[Price])
please suggest if we have any other option
Thank you

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

Apologies John you are right some how while testing I might have added the same measure 

Thank you again the measure works

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.