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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Babakhsn
Helper I
Helper I

Joining Two Tables

Hello Everyone,

I have the two following tables:

 

Task Table:

Screenshot 2023-11-27 131845.png

 

Project Table:

Screenshot 2023-11-27 131852.png

 

In the task table, I want to have the last column (Status). It is not originally there, it's part of project table. I want to do a join between the two tables based on Projectid, but I haven't been successful so far with DAX.

 

Could someone guide me?

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Babakhsn 

 

You can try the following methods.

Column = CALCULATE(MAX('Project Table'[Status]),FILTER('Project Table',[Projectid]=EARLIER('Task Table'[Related Project Id])))
Column 2 = LOOKUPVALUE('Project Table'[Status],'Project Table'[Projectid],[Related Project Id])

vzhangti_0-1701223553760.png

Is this the result you expect? Please see the attached document.

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Babakhsn 

 

You can try the following methods.

Column = CALCULATE(MAX('Project Table'[Status]),FILTER('Project Table',[Projectid]=EARLIER('Task Table'[Related Project Id])))
Column 2 = LOOKUPVALUE('Project Table'[Status],'Project Table'[Projectid],[Related Project Id])

vzhangti_0-1701223553760.png

Is this the result you expect? Please see the attached document.

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

FreemanZ
Community Champion
Community Champion

hi @Babakhsn ,

 

try to add a calculated column like:

Status =
LOOKUPVALUE(
    Project[Status],
    Project[Project],
    Task[Related Project]
)
philouduv
Resolver III
Resolver III

Hello @Babakhsn ,
In the Table view go on the Task Table(select it on the right side panel), click on new column and write :

- If a relation exist between the two tables (one to many on the ProjectID ==> Related project ID):
Status =
CALCULATE(SELECTEDVALUE(Project_table[Status]))
-
else (Meaning we would need to introduce the relationship directly into the dax formula)
Status = CALCULATE(SELECTEDVALUE(Project_table[Status]),FILTER(Project_table, Project_table[ProjectID] = Task_Table[Related project ID]))

Best regards,


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.