DAX average with different level

potap

New Member
Joined
Sep 5, 2014
Messages
43
Hi!

I am looking for a way to calculate the average cost by department without having to drag this field in the pivot table or as a slicer.

Let's say I have this pivot table that has a slicer on region 1 :

UnitTotalCost
A1000
B1600
C800
D1200

<tbody>
</tbody>

My fact table looks like this :

OrderNumDateUnitEENumCost

<tbody>
</tbody>

My fact table as a relationship with this dimension table :

UnitRegionDepartment
A1XX
B1XX
C1XX
D1XX
E2YY
F2YY
G2YY
H3XX
I3XX

<tbody>
</tbody>

The new column has to calculate the average cost of unit A, B, C and D (shown in the pivot table) but also unit H and I (same department).

If these are the total cost of region 3 :

UnitTotalCost
H400
I600

<tbody>
</tbody>

The new column should show 700 as the average cost of department XX

UnitTotalCostDeptAverage
A1000700
B1600700
C800700
D1200700

<tbody>
</tbody>


Thanks for your help!!!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Wow thank you!!! Can't say I really understand Earlier but I'll try with the link you provided.
 
Upvote 0

Forum statistics

Threads
1,216,178
Messages
6,129,326
Members
449,501
Latest member
Amriddin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top