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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Employee
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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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