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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
wkeicher
Helper III
Helper III

Calculate Total Cost of multiple projects by resource

I am looking for assistance in summing the total cost of a resource accross all projects based on hours X rate (Where rates are differentdepending on project).

 

Table of hours entered by Resource, date, projectid - 

Billable Hours = SUM(ActivityUpdates[RegularHours]) + SUM(ActivityUpdates[OTHours])

 

Table of rates by projectid and resource - Need to calculate the hours for given project multiplied by the resource rate for that project and sum all by resource.

 

Result - resource - total hours - total cost

11 REPLIES 11
Anonymous
Not applicable

HI @wkeicher,

Please share some dummy data with same data structure and expected result, it will help for test and coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

 

So I am Using a Matrix Visual with a calculated field (Billable Cost) - The sum of the detail in yellow is not accurate. I am trying to aggreagte the values by ticket Numberand resource up to the resource level. A Table Visual shows all the values correctly but doesn't aggregate at the resource level.

 Sample.png

More info - 3 tables - All Joined by Ticket Number

Activity Updates (Conatins entries of hours for each time entry against a ticket)

Tickest Resources (Contains HourlyCost by Resource for each Ticket)

Tickets - (Contains Ticket Details)

 

Tables.png

Anonymous
Not applicable

HI @wkeicher,

It seems like your records have been effect by activated relationship, maybe you can try to use USERELATIONSHIP function to calculate based specific relationship mapping.

USERELATIONSHIP in Calculated Columns 

Regards,

Xiaoxin Sheng

This is defnately helpful, but it also seems that I cannot Sum the ActivityUpdated[Hours] * TicketResources(HourlyCost]?

 

ActivityUpdates[Hours] needs tobe summed by TicketNo, then Multiply by the TicketResource][HoulyCost] for that same specific TicketNo

 

There are two issues - Sum ActivityUpdated[Hours] by TicketNumber and then by resource

Then Multiply the result by Resources Rate for that same TicketN.

 

 

Billable Cost Measure is what is troubling me I think.

 

Billable Cost = CALCULATE(SUMX(ActivityUpdates,ActivityUpdates[Hours]) * Average(TicketResources[HourlyCost]), USERELATIONSHIP(PSDRoles[Resource Name],TicketResources[Resource]))
I cant eem to get the calcuation to calculate by just the field.
 
Ex.png
Anonymous
Not applicable

Hi @wkeicher,

Can you please share some dummy data with minmium core data stucurtre for test? It will help to test and coding formulas.

How to Get Your Question Answered Quickly  

In addition, please double check your formal to confirm you have activated the corresponding relationship mapping in your calculations expressions.

Billable Cost =
CALCULATE ( SUM ( ActivityUpdates[Hours] ), ActivityUpdates )
    * CALCULATE (
        AVERAGE ( TicketResources[HourlyCost] ),
        USERELATIONSHIP ( PSDRoles[Resource Name], TicketResources[Resource] )
    )

Regards,

Xiaoxin Sheng

I think the issue is the use of Average. or Sum in the calculation. What I need is the actual cost summed in the Matrix. The value should be$776 + 34,425 = 35,201  

calc1.png

 

 

Calc.png

piyushszope
Helper I
Helper I

To calculate the hours for a given project multiplied by the resource rate you can use the SumX and the Related function together. For example, 

= SUMX(ResorceHrsTable,ResorceHrsTable[Hrs] * RELATED(RatesTable[Cost]))

**Important to create a relation between both the tables 

 

Thank you - How do I create a relation between the two tables?

For more details, you can review this video by Alberto Ferrari. I hope this will clear all your doubts regarding the Related function and the relationships.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors