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

Sum values based on distinct ID, group by another column

Hi Everyone. I need some help:

I am trying to display a pie chart, of grouped and sum values based on a distinct ID

My data looks like this:

ID

Amount

Code

1

220

G

1

220

 

2

350

F

2

350

 

2

350

 

3

125

G

3

125

 

4

220

F

4

220

 

Currently, I am using filters and sum measures but my results are summing every value, not the one value based on the ID. My current results are as so:

Total Sum = 2180

Group G: Sum = 690

Group F: Sum = 1490

Which is incorrect, as it is summing every value.

 

I need my results to be: 

Total Sum = 915

Group G: Sum = 345

Group F: Sum = 570

As I am trying to display these groups in a pie chart. 

 

 

 

Anyone have a fix for this? Thanks in advance

1 ACCEPTED SOLUTION

9 REPLIES 9
Ronald123
Resolver III
Resolver III

@Anonymous,

TotalAmount = SUM('Table'[Amount])

Naamloos.png
 
Greetz,
 
Ronald




Anonymous
Not applicable

This gives me the same incorrect results unfortunately. 

@Anonymous ,

 

Please, share a sample oy your data.

It isn't logic to gets incorect value's.

Greetz,

 

Ronald

 

 

 

 

 

 

Anonymous
Not applicable

Unfortunately I can't share the actual data:

However it looks like this: 

IDAmountCode
120G
120J
240G
240Y
240J
365F
365Y
4100F
4100Y
4100J
550G
550Y
550J
550N
620F
620J

I want to sum the Amount(only one value for each ID) based on the ID, and grouped in group G or F (not interested in the other codes). Because the amounts are repeated for each ID, it sums all the amount values. 

@Anonymous ,

 

What are the expected values for the code:

G :
F :


Greetz,

 

Ronald

Anonymous
Not applicable

G = 110 

F = 185 

Total = 295 

 

I think the total is the problem, it isnt summing only codes G and F it's including every single amount listed.

So my total ends up being 830 instead of 295

 

 

Thanks Ronald for your help 🙂 

@Anonymous ,

 

Check the file;

 

https://1drv.ms/u/s!An5X7wdH9O9eiWvhOWkMJrheqa9H

 

Greetz,


Ronald

Anonymous
Not applicable

That made things much clearer!. Thank you Ronald, I have solved my problem

Anonymous
Not applicable

Hi all,

 

I have the same problem than @Anonymous , but I am not able to reach de link information.

 

Please, @Ronald123 , can you share it again?

 

Thanks in advance.

Paco.

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.