Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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 Hours
Operating Cost/hour
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
Best Regards
Rena
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.
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
78 | |
54 | |
39 | |
35 |
User | Count |
---|---|
102 | |
84 | |
48 | |
48 | |
48 |