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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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