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 August 31st. Request your voucher.

Reply
bhalicki
Helper IV
Helper IV

DAX Lookup Value in another table with filter (calculated column)

Hi all,

I have the following tables, relationships and data:
Project:

bhalicki_0-1725077712082.png

Task:

bhalicki_2-1725077745225.png


ProjectPhaseSummary:

bhalicki_3-1725077768832.png

 

bhalicki_4-1725077788221.png

 

I want to add calculated columns to "ProjectPhaseSummary", so that I end up with the following:

bhalicki_5-1725078526828.png

Hoping someone can please suggest the most accepted way of generating the information above with DAX (preferably using CALCULATE).

Thanks,

Ben.

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @bhalicki 

As an example:

PlanningStarDate =
MAXX (
FILTER ( Project, Project[ProjectId] = ProjectPhaseSummary[ProjectId] ),
MAXX (
FILTER ( RELATEDTABLE ( Task ), Task[Phase] = "Planning" ),
Task[StartDate]
)
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @bhalicki 

As an example:

PlanningStarDate =
MAXX (
FILTER ( Project, Project[ProjectId] = ProjectPhaseSummary[ProjectId] ),
MAXX (
FILTER ( RELATEDTABLE ( Task ), Task[Phase] = "Planning" ),
Task[StartDate]
)
)

MattAllington
Community Champion
Community Champion

If you have some flex on the exact layout, you should be able to do it with minimal DAX. 
add a matrix 

put project[proj id] onto rows

put task[phase] onto columns

Write this measure and add it to values

date range = SELECTEDVALUE(Task[startdate]) & " - " & SELECTEDVALUE(Task[enddate])

 

with your current data, the 3 phases will not sort correctly. You could add a sort order column to fix this. If it were me, I would create a new phase dim table in power query and add a sort column, 1 for planning, 2 for design, 3 for execute. Load it into the model join it to the task table, then sort the dim text column by the sort column. Replace the phase column in the visual (remove the phase from task and add phase from the dim table}



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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