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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
thlndlmngls
Frequent Visitor

Divide values of two columns from different tables using group by

Hello.


I would like to know how to divide the values of two columns from two different tables using group by.

 

I made a table that used three data below and all the data come from the different tables. (There is no direct relatiopnships among those tables.)

-Table 1 [ID]

-Table 2 [Hours]

-Table 3 [Amount]

Capture.PNG

 

Now the calculated information below should be put in the table as well.

- Table 3 [Amount]/ Table 2 [Hours] group by Table 1 [ID]

 

I tried to create a new column to calculate above, but it is impossible as the data comes from the different tables and there is no direct relationship among the tables.

 

 

Should I create a new table to show this data or is it possible to use measure?

 

Would you tell me how to solve this problem?

 

Thank you in advance!

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Assuming ID is the common column in both tables, create another Table with a single column which lists all unique ID's.  Build a relationship from the ID column of Table2 and Table3 to the ID column of this new Table.  To your visual, drag the ID field from this new table.  Write these measures

Total = SUM('Table3'[Amount])

Hours spent = SUM('Table2'[Hours])

Measure = [Total]/[Hours spent]

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Assuming ID is the common column in both tables, create another Table with a single column which lists all unique ID's.  Build a relationship from the ID column of Table2 and Table3 to the ID column of this new Table.  To your visual, drag the ID field from this new table.  Write these measures

Total = SUM('Table3'[Amount])

Hours spent = SUM('Table2'[Hours])

Measure = [Total]/[Hours spent]

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello Ashish,

 

Thank you for your reply.

It works well and the calculated data is put into the table.

 

Thank you so much again.

 

Regards

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
calerof
Impactful Individual
Impactful Individual

Hi @thlndlmngls ,

 

I thought I replied to your question a minute ago. Have you made relationships between the tables yet?

 

Regards,

 

Fernando

 

Hello Fernando,

 

Thank you for your reply.

There was something went wrong so I have created the post again.

 

I have tried to use measure but cannot refer the columns from the tables.

 

>Have you made relationships between the tables yet?

Yes, but there is no direct relationship among tables.

 

Regards

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.