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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

add column from another table by using filter

Hello all, 

I have two related tables(lets say table1 and table2) as below:

hmp_229_0-1594622465087.png

hmp_229_1-1594622514516.png

I want to move the column 'Duration_min' in table2 to table1 but it has to be filter by bay_id and group by description_id. the final goal is to calculate the total usage of water like 'average_flow'*'duration_min'.

 

I would be so approciated if anyone could help with this problem.

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi , @Anonymous 

It is suggest to   move the column 'AverageFlow' in table1 to table2  rather than move the column 'Duration_min' in table2 to table1 due to the relationship between table1 and table2(one-to-many rather than many-to_one ).

You can create caluculated column as below :

Average Flow = LOOKUPVALUE('Table 1'[AverageFlow],'Table 1'[bay_id],'Table 2'[bay_id])
total usage of water = 'Table 2'[Duration_Min]*'Table 2'[Average Flow]

The result will show as below:

55.png

 

You also can create measure as below:

total usage of water = SELECTEDVALUE('Table 1'[AverageFlow])*SELECTEDVALUE('Table 2'[Duration_Min])

57.png

You can also hide the columns you don’t need by reducing the row width manually in table visual.

 

pbix attached

 

Best Regards,
Community Support Team _ Eason

 

 

 

 

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi , @Anonymous 

It is suggest to   move the column 'AverageFlow' in table1 to table2  rather than move the column 'Duration_min' in table2 to table1 due to the relationship between table1 and table2(one-to-many rather than many-to_one ).

You can create caluculated column as below :

Average Flow = LOOKUPVALUE('Table 1'[AverageFlow],'Table 1'[bay_id],'Table 2'[bay_id])
total usage of water = 'Table 2'[Duration_Min]*'Table 2'[Average Flow]

The result will show as below:

55.png

 

You also can create measure as below:

total usage of water = SELECTEDVALUE('Table 1'[AverageFlow])*SELECTEDVALUE('Table 2'[Duration_Min])

57.png

You can also hide the columns you don’t need by reducing the row width manually in table visual.

 

pbix attached

 

Best Regards,
Community Support Team _ Eason

 

 

 

 

amitchandak
Super User
Super User

@Anonymous , This how you can mode data from one table to another first one will only work in case 1-M join to copy in the table on M side

Item Name = RELATED('item'[Brand]) // Item to  sales

City Name = maxx(FILTER(geography,geography[City Id]=Sales[City Id]),geography[City]) // City to sales

Month Name = LOOKUPVALUE('date'[Month Year],'date'[Date],Sales[Sales Date]) // From Date to sales

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.