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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Cost per unit for each department

Hello

 

will you please help? 

I have to calculate cost per unit of production for each department, i.e. how much each department brings to a unit cost.

 

Please see below the database structure. Both volume and cost data sit in _data_table which is basically an accounting ledger. 

mira_abel_1-1598962055643.png

 

I can calculate through a measure a trend of base cost per month per department (with the help of non-related calendar filter). 

mira_abel_2-1598962120493.png

Volume sits in Production accounts and not in the department hierarchy.

 

mira_abel_3-1598962688976.png

I need to show a table with a list of departments and months with a value equal to each department cost divided by the volume of production in that month.

 

Will you please help solving this? 

 

Many thanks

Mira

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello All

 

If interested, I found a solution. I created a separate calculated table for volumes by month, so that there is no connection to Cost Code lookup. Then a measure to divide the departmental costs by the volume by month. My problem was that if I calculated it all from the same datatable the Cost Code active relationship was holding it from showing results by departments. 

 

If interested please let me know. 

Thank you 

Mira

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Anonymous - Difficult to understand exactly how the calculation needs to be. Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I have the following datatable:

LedgerAccount CodeCost CodeAccPeriod Transaction Amount 
A705320112OPX13201-Sep-18          1,190.16
A705320131OPX09001-Sep-18          1,644.55
A705320132OPX04201-Sep-18          3,344.00
ASALEGAS132REV00101-Sep-18-        2,328.88
ASALEGAS111REV00101-Sep-18                10.38
ASALEGAS112REV00101-Sep-18                33.36
ASALENGL132REV00201-Sep-18                  4.79
ASALENGL131REV00201-Sep-18             693.15

 

I have three measures to calculate (1) total operating costs and (2) total volume and (3) unit costs (1 divided by 2)

Please see below: 

 

Table 1.PNG

 

Table 2.PNG

I can calculate each department cost as shown above based on Cost Code in the right corner. However, I need a solution to calculate each department's share in the unit costs, as shown

 
 
 

Kind regards

Mira

 

 

 

 

Anonymous
Not applicable

Hello All

 

If interested, I found a solution. I created a separate calculated table for volumes by month, so that there is no connection to Cost Code lookup. Then a measure to divide the departmental costs by the volume by month. My problem was that if I calculated it all from the same datatable the Cost Code active relationship was holding it from showing results by departments. 

 

If interested please let me know. 

Thank you 

Mira

Anonymous
Not applicable

@Greg_Deckler  

Is my problem clear? 🙂 I am not sure...

Thank you

Mira

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors