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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
bhalicki
Helper V
Helper V

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.