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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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