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.
Hi,
I've got a simple (I think) DAX question in order to solve this problem. Here's the thing:
I have 4 tables: Dim_employee, Dim_department, Sales, Accounting.
Now, the sales in the Sales-table are connected to the Employee ID which makes it easy for me to show the Sales per Employee. However, the cost/overhead (Accounting) is connected to the Department ID (which x-employee is a part of).
I basicly want to make a simple table that shows sales per employee and their share of the overhead (based on the total overhead for the department, divided by the number of employees in said department). I'm using this formula:
=DIVIDE([Overhead];DISTINCTCOUNT(Dim_Department[EmployeeID]))
This works if I show it per department, but I want to show this number per employee. If I create a table with employeeID, sales and the measure above, I figure it only counts one distinct ID per employee. Now, this is technically correct I suppose, but if a department has 10 employees, I want the overhead per employee measure to show Overhead/10 (in other words, all the employees in the department should be factored in).
Hope this is a sufficient description of my problem. Thanks for any help in advance.
Solved! Go to Solution.
@Anonymous
Hi,
Firstly, change all the “Cross filter direction” of the relationships into “both”. Secondly, try this measure:
Measure = DIVIDE ( SUM ( Accounting[Overhead] ), CALCULATE ( DISTINCTCOUNT ( DIM_department[Employeeid] ), ALLEXCEPT ( DIM_department, DIM_department[DepartmentID] ) ) )
Best Regards!
Dale
Can you show the pic of sample pivot you are using ... also with the desired results in the next column
@Anonymous
Hi,
Could you tell me if your problem is solved? You can mark the right answer to help others if it's convenient for you.
Best Regards!
Dale
Yes it would be nice to get some feedback
Can you at least post model layout? Not sure what measures to produce without knowing how all tables are related.
Sorry, hope this is of some help.
@Anonymous
Hi,
Firstly, change all the “Cross filter direction” of the relationships into “both”. Secondly, try this measure:
Measure = DIVIDE ( SUM ( Accounting[Overhead] ), CALCULATE ( DISTINCTCOUNT ( DIM_department[Employeeid] ), ALLEXCEPT ( DIM_department, DIM_department[DepartmentID] ) ) )
Best Regards!
Dale
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |