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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Get Column based on filters from another table.

I have 2 tables. 

 

Table 1 has many columns including - CapacityPerDay, Assignee name, IterationId etc.. 

Table 2 has many columns including Assignee name, IterationId etc.. 

 

I need to  get CapacityPerDay from table 1 into table 2 based on Filter where Table1[IterationId] = Table2[IterationId] && Table1[Assignee] = Table2[Assignee]

 

There is Many to Many relation between tabels on IterationId column. 

 

I am using something like this : 

TeamMemberCapacity = CALCULATE(FIRSTNONBLANK(TeamCapacity[Custom.Column1.activities.capacityPerDay],MAX(TeamCapacity[Custom.Column1.activities.capacityPerDay])), TeamCapacity[IterationId] = CurrentSprint[IterationId] && TeamCapacity[Custom.Column1.teamMember.displayName.1] =CurrentSprint[Assignee])
 
Error : The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression.
 
Could you please help? Thanks
1 ACCEPTED SOLUTION

This how I get a column from table2 to table1.Example 

New column in Table 1 = maxx(filter(table2,table1[customer] = table2[customer] && table2[option]="construction",table2[value])

New column in Table 1 = maxx(filter(table2,table1[Attribute] = table2[name] && table1[project] = table2[project],table[name])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

 

 

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

View solution in original post

5 REPLIES 5
az38
Community Champion
Community Champion

Hi @Anonymous 

try to use FILTER() and SELECTEDVALUE()

like

CALCULATE(FIRSTNONBLANK(TeamCapacity[Custom.Column1.activities.capacityPerDay],MAX(TeamCapacity[Custom.Column1.activities.capacityPerDay])), 
FILTER(ALL(TeamCapacity),
TeamCapacity[IterationId] = SELECTEDVALUE(CurrentSprint[IterationId]) && TeamCapacity[Custom.Column1.teamMember.displayName.1] =SELECTEDVALUE(CurrentSprint[Assignee]))
)

do not hesitate to give a kudo to useful posts and mark solutions as solution

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Thanks @az38  It does not give me error now but all rows give me blank now. 

This how I get a column from table2 to table1.Example 

New column in Table 1 = maxx(filter(table2,table1[customer] = table2[customer] && table2[option]="construction",table2[value])

New column in Table 1 = maxx(filter(table2,table1[Attribute] = table2[name] && table1[project] = table2[project],table[name])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

 

 

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
Anonymous
Not applicable

Thanks @amitchandak it worked for me. 

az38
Community Champion
Community Champion

@Anonymous 

show please an example of your data model.

bytheway, why do you use 

FIRSTNONBLANK(TeamCapacity[Custom.Column1.activities.capacityPerDay],MAX(TeamCapacity[Custom.Column1.activities.capacityPerDay]))

but not simple

FIRSTNONBLANK(TeamCapacity[Custom.Column1.activities.capacityPerDay],1)

?

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.

Top Kudoed Authors