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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
tjshaf13
Frequent Visitor

Calculating Operating Cost of Equipment

I am trying to calculate the total operational cost for individual pieces of equipment.

I have the cost/hour for each piece of equipment and the number of hours each piece of equipment has operated/day. 

This information is coming from two different data sets, but is associated via the "Equipment Number" field. 

I know is a simple matter of multiplication, but I can't get a measure to work. I am relatively new to Powerbi so there is probably something obvious that I am missing. Thanks for you help in advance

 

Here are pictures of my data sets

 

Daily Operating HoursDaily Operating HoursOperating Cost/hourOperating Cost/hour

3 REPLIES 3
v-yiruan-msft
Community Support
Community Support

Hi @tjshaf13 ,

First, please make sure there is one relationship based on equipment number be created between these two tables. Then create a measure as below to get the operation cost of per equipment.

Operating Cost of Equipment = var _cEquip=max('Operating Costs'[Equipment Number])
var _totalHour=CALCULATE(SUM('Daily Operating Hours'[TotalHoursCrushing]),FILTER('Daily Operating Hours','Daily Operating Hours'[EquipmentNumber]=_cEquip))
var _cost=CALCULATE(MAX('Operating Costs'[Cost]),FILTER('Operating Costs','Operating Costs'[Equipment Number]=_cEquip))
return _totalHour*_cost

Calculating Operating Cost of Equipment.JPG

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

If the Daily Operating hours table is not very large, then you may write a calculated column formula to bring over the Cost field from the Operating Cost/hour table by using this formula: =RELATED('Operating Cost/hour[Cost]).  You must first build a relationship from the Equipment Number column of the Operating Cost/hour table to the EquipmentNumber column of the Daily Operating hours table.  Lastly, write this measure

=SUMX('Daily Operating hours','Daily Operating hours'[TotalHoursCrushing]*'Daily Operating hours'[Cost])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mahoneypat
Microsoft Employee
Microsoft Employee

Assuming your "Equipment" table (2nd one) has a 1:Many with the "Hours" table with Hours.  Make a table visual with the Equipment Number from the Equipment table and use a measure like this.

 

Total Cost = var costperhour = Sum(Equipment[Cost] //since one value per equipment, other aggregation would work (max, min)

var hours = sum(Hours[TotalHoursCrushing]

return costperhour*hours

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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