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
Christoph1972
Regular Visitor

How to get sum by group and related table?

I have two tables:

Table Jobs:

ID; Name; TaskID
1; Job1; 1
2; Job1 ;3
3; Job1; 3
4; Job2; 2
5; Job2; 3
6; Job2; 3
7; Job3; 1
8; Job4; 2
9; Job4; 1

 

and a table with costs for a specific task.

Table Task:

ID; Name; €
1; Cleaning; 5
2; Testing; 10
3; Replacing; 20

 

I created a relation between Jobs.TaskID and Task.ID. How to get the sum (€) of tasks of a job? I like to get the following output:

Job1; 45
Job2; 50
Job3; 5
Job4; 15

 

I got only the following output:

 

Christoph1972_0-1671455145733.png

That’s quite different as expected. Any ideas how to get the sum (€) of each job?

Kind regards
Christoph

1 ACCEPTED SOLUTION
Christoph1972
Regular Visitor

The Power Query Editor served exactly what I needed. Go to Combine and create the relation there.

 

Christoph1972_0-1671460218568.png

Then the model shows exactly what I need:

Christoph1972_1-1671460218568.png

 

Thanks a lot! 😊

 

View solution in original post

3 REPLIES 3
Christoph1972
Regular Visitor

The Power Query Editor served exactly what I needed. Go to Combine and create the relation there.

 

Christoph1972_0-1671460218568.png

Then the model shows exactly what I need:

Christoph1972_1-1671460218568.png

 

Thanks a lot! 😊

 

FreemanZ
Super User
Super User

Hi @Christoph1972 

try to

1) remove the TaskID from the table visual. 

2) Jobs Table and Task Table shall be related one-to-many. Is that the case?

Thanks for your reply!

Removing the TaskID doesn't fix it.

Yes, related one-to-many is correct.


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.