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
PhilBrookbanks
Frequent Visitor

FTE Calculation with Totals

Hi, I'm hoping somebody can help with the below issue. I've recreated an example in excel as I think this is the easiest way to show.

 

My model has 2 tables. A sales table and a staff HR table containing the number of hours worked and FTE (hours/40).

 

Sales Table

 

User IDDate Sold
Madelaine Hall14/03/2022
Lydia Slade29/03/2022
Amy Humphris20/03/2022
Jo Dews12/03/2022
Robyn Archer25/03/2022
Amanda Hamilton25/03/2022
Lydia Slade05/03/2022
Amy Humphris26/03/2022
Jo Dews06/03/2022
Madelaine Hall25/03/2022
Lydia Slade04/03/2022
Amy Humphris11/03/2022
Jo Dews26/03/2022
Robyn Archer29/03/2022
Amy Humphris28/03/2022
Jo Dews30/03/2022
Robyn Archer05/03/2022
Amanda Hamilton12/03/2022
Lydia Slade13/03/2022

 

Staff Table

 

User IDHoursFTE
Madelaine Hall401
Lydia Slade401
Amy Humphris350.875
Jo Dews200.5
Robyn Archer401
Amanda Hamilton300.75

 

I have a relationship on the staff ID between the 2.

 

I wish to produce a table in Power BI that shows total sales by staff member alongside hours worked and FTE like the below.

 

User IDSalesHoursFTE
Madelaine Hall2401
Lydia Slade4401
Amy Humphris4350.875
Jo Dews4200.5
Robyn Archer3401
Amanda Hamilton2300.75
Total192055.125

 

I'm struggling with the DAX to get the totals for Hours and FTE without them adding up for every sale. e.g. 2 sales and 40 hours becoming 80 hours. Any help would be greatly appreciated.

 

Thanks

Phil

1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@PhilBrookbanks I replicated your data at my end and simply joining one to many cardinality based on UserID, I just dragged and dropped the fields from both the table and it's showing me the correct result.

 

Capture.JPG

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Tahreem24
Super User
Super User

@PhilBrookbanks After my below post I am attaching PBIX for your reference.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Tahreem24
Super User
Super User

@PhilBrookbanks I replicated your data at my end and simply joining one to many cardinality based on UserID, I just dragged and dropped the fields from both the table and it's showing me the correct result.

 

Capture.JPG

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Worked when I switched the table to use the User ID dimension from the staff table rather than the orders table.

amitchandak
Super User
Super User

@PhilBrookbanks , Measures like

sold = sum(sales[sales])

 

Total Hours = summarize(Staff , Staff [User ID], Staff[Hour]), [HOUR])

 

Total FTE= summarize(Staff , Staff [User ID], Staff[FTE]), [FTE])

Hi,

Thank you for your reply, I'm not sure that this solution works as my staff table is already a dimension table with unique entries I already essentially have it summarised by staff id and hours. my issue is that when looking at data from the fact table (sales) it is summing up the assocated hours and therefore the total in the table becomes a sumproduct. I need the measure to not sum in the table and then the total to be the sum of these.

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.