cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mpsAutomation
Frequent Visitor

Obtain sum of subcategory

Hi,

 

I am tryin to make the Calculated rate the same acroos the parent task

calculate srate = budget/ forecast

The problem I have is that subtasks $ spent (spent*Calculated rate) do not equal the parent task result (in bold). So I need to make the calculated rate the same for the children of that parent task

I tried Sum(budget)/sum(forecast) but it gives me the rate of the entire job, e.g. children of task a and b, etc. is there a way to filter it? the same needs to be done for each parent task

 

Job ABudgetForecast Calculated rateSpent$ Spent
Task a          39,130           258                    15286.3 13,088.83
Subtask a          11,180             86                    1300                 -  
Subtask b          27,950           172                    16386.3  14,023.75
Task b     
Subtask d     
Subtask e     
Subtask f     
1 REPLY 1
amitchandak
Super User
Super User

@mpsAutomation , Try like

 

calculate(Sum(Table[budget])/sum(Table[forecast]), removefilter(Table[Subtaks]))

 

or

 

calculate(Sum(Table[budget])/sum(Table[forecast]), all(Table[Subtaks]))

 

 

Similar logic used here

Percent of Total and Percent of SubTotal https://www.youtube.com/watch?v=6jTildcV2ho



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Dev Camp Session 26

Check it Out!

Mark your calendars and join us on Thursday, September 29 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors