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
95Bigbluetoy
Helper I
Helper I

Calculate percentage of Job Cost hours and Overhead hours

Power Bi table.PNG

 

I am new to power bi and need some help calculating JC hrs and OH hrs. I have filtered my data and have added calculated columns for Total Hours, JC hrs and OH hrs. As you can see in my matix table above, the Total hrs column shows the total hrs for all cost centers for each employee (each row) and a column total. The JC hrs column shows the total hrs for certain cost centers for each employee (row) and column total and the OH hrs column shows the total hrs for each employee (row) for certain cost centers and the column total hrs. I need to show the % of JC hrs and % OH hrs for each employee (row) and percentage of total hrs (column) based on their total hrs. I tried the formula


% JC Hrs = DIVIDE( SUM(TC_History[Job Cost Hrs]), SUM(TC_History[Total Hrs] )) but as you can see, it does not return the correct values. The first employee should show 1 (100%) % JC hrs but is showing as 31.05.
 
All help is greatly appreciated.

 

 

 

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @95Bigbluetoy ,

Did you calculate the values of % JC Hrs using a calculated  column? If so, you need to create a measure. Then the formula is working. 

1.PNG

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xuding-msft
Community Support
Community Support

Hi @95Bigbluetoy ,

Did you calculate the values of % JC Hrs using a calculated  column? If so, you need to create a measure. Then the formula is working. 

1.PNG

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Yes I did. thanks for your help. I created the measure and it is working now. Being new to this, a bit confused as to what to use when.

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.