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
Anonymous
Not applicable

calculate sum distinct values based on another column

Hi,

 

I'm try to calculate Project value based on ID column distinct value. I have a table with columns It looks like this:

 

Project category Sub Category Project ValuePlantStatusEffortsID
CTWPackaging180000Columbus On Hold0.001
CTWPackaging180000Columbus On Hold0.001
CTWPackaging54000DroghedaOn Track0.102
CTWPackaging54000DroghedaOn Track0.102
CTWPackaging50000CurtibaOn Track0.303
CTWPackaging50000CurtibaOn Track0.303
CTWPackaging26000JDFOn Track0.154
CTWPackaging26000JDFOn Track0.154
CTWPackaging55000ColumbusOn Track0.355
CTWPackaging55000ColumbusOn Track0.255
CTWPackaging55000ColumbusOn Track0.105
CTWProduct30000TuasOn Track0.606
CTWProduct30000TuasOn Track0.606

 

i want sum of Project value using DIstinct value of ID ,  i have ID duplicate values but i want to find (ID column) unique value based Project values

 

i tried measure , it's not working if i using Group by means it's work but i need other columns 

 

Total sales = SUMX(DISTINCT('table'[Id]),MAX('table'[Project Value]))
 
Any help there? I'm was searching through community posts but nothing worked for me
 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Try like

 

Total sales = SUMX(values('table'[Id]),calculate(MAX('table'[Project Value])))

View solution in original post

Anonymous
Not applicable

Hi,  

 

i have tried 

 

Total sales = CALCULATE(SUMX('table','table'[Project Value]),MIN('table'[Id],0))

 

Total sales = SUMX(values('table'[Id]),calculate(MAX('table'[Project Value])))

 

Both are working for me thanks for your support

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi,  

 

i have tried 

 

Total sales = CALCULATE(SUMX('table','table'[Project Value]),MIN('table'[Id],0))

 

Total sales = SUMX(values('table'[Id]),calculate(MAX('table'[Project Value])))

 

Both are working for me thanks for your support

Jihwan_Kim
Super User
Super User

Total sales : =
SUMX (
DISTINCT ( 'table'[Id] ),
CALCULATE ( DISTINCT ( 'Table'[Project Value] ) )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


amitchandak
Super User
Super User

@Anonymous , Try like

 

Total sales = SUMX(values('table'[Id]),calculate(MAX('table'[Project Value])))

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.