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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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 

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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