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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Matt22365
Resolver III
Resolver III

Calculate aggregate value based on filtering another table

Hi

I hope someone can help

I am using 2 tables from MS Project in Power BI, Tasks and Task Baseline

 

I would like to aggregate the costs column from "Tasks" against the task baseline finish date from "Task Baseline" into a line chart

I have managed to do this to a different date column in the same table, but cannot get it to work between tables. 

This is the formula which works (within the same table):

Running Total = CALCULATE(SUM(Tasks[TaskFixedCost]),FILTER(ALLSELECTED(tasks),Tasks[TaskFinishDate] <=MAX(Tasks[TaskFinishDate])))

 

but rather than Tasks[TaskFinshDate] I need it to be TaskBaselines[TaskBaselineFinishDate]

 

I have a 2 way relationship between these 2 tables and the data presents correctly in a table visual, I just cannot get the aggregate to work

 

Any help would be greatly appreciated

 

Thanks

 

Matt 

 

1 ACCEPTED SOLUTION
Matt22365
Resolver III
Resolver III

Thanks for everyones help

 

The simplist fix I found was to merge the 2 tables based on task ID. This puts both the finish date and baseline finish date in the same table so I could then do the calculation

 

Thanks

 

Matt 

View solution in original post

7 REPLIES 7
Matt22365
Resolver III
Resolver III

Thanks for everyones help

 

The simplist fix I found was to merge the 2 tables based on task ID. This puts both the finish date and baseline finish date in the same table so I could then do the calculation

 

Thanks

 

Matt 

amitchandak
Super User
Super User

@Matt22365 , refer how to use two dates using date table and userelation

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
vanessafvg
Super User
Super User

can you screen shot your relationships?




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Hi

Relationship screenshot as requested.

TaskBaselines - Tasks -> TaskID

Projects - Tasks -> ProjectID

 

Thanks

Matask baseline.JPGtt 

have you tried using the related function? test =
CALCULATE (
SUM ( Tasks[TaskFixedCost] ),
FILTER (
ALLSELECTED ( tasks ),
RELATED ( TaskBaselines[TaskBaselineFinishDate] )
<= MAX ( TaskBaselines[TaskBaselineFinishDate] )
)
)

if you provide some dummy data i can check what i am doing, otherwise give that a bash




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Hi

Thanks. Unfortunately it wont let me use related between these 2 tables.

I cannot link you to data due to my companies security, however essentially the key information from the 2 tables is:

Tasks:

 - TaskID

 - TaskFixedCost

 - TaskFinishDate

 

TaskBaselines:

 - TaskID

 - TaskBaselineFinishDate

 

So I need to aggreate TaskFixedCost and plot it againt TaskFinishDate

 

Thanks

 

Matt 

 

what error do you get? do you need all your bidirectional relationships?




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.