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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

calculating %age resource allocation

Hi,

 

I am creating a report to calculate %age allocation of each resource per month. It varies per month because there are different working hours each month. I am trying to calculate CAP by Workinghours to derive the %age. CAP is a measure while Workinghours is a column and PowerBI is not letting me do that. Can anyone help me with that. 

 

Here is the data set:

 

Year-MonthWorkinghoursCAP
2020-01154154
2020-0214021

 

1 ACCEPTED SOLUTION

Hi , @Anonymous 

Try measures as below:

%age CAP = 
sumx(
    'Table',
    [CAP]/CALCULATE(MAX('Table'[Workinghours]))
)

Pbix attached

 

Best Regards,
Community Support Team _ Eason
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

6 REPLIES 6
amitchandak
Super User
Super User

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

We have capacity of each resource in Project Online i.e. CAP. For each resource, I have entered that how many hours each resource is available per month.  I need to convert the capacity for each resource to a %age. For this I need to divide the capacity by number of working hours per month. 

 

Lets say I have a capacity of 26 hours in for Month of January and there are 154 working hours in the month, so my %age capacity will 26/154*100

 

When I try to divide capacity by working hours, I get an error - "A single value for column"Workinghours" in table "Hourspermonth" cannot be determined. This can happen when a measure formula referes to a column taht contains many values without specifiying an aggregation such as min, max, count, or sum"

 

Hope this helps. 

Hi , @Anonymous 

If I understand your requirement correctly that you want to   divide  "CAP" by  "Workinghours "
 "CAP" is a measure , "Workinghours " is a calculate column ,right ?

If it is ,please kindly show me the dax formula  about "CAP" and "WorkingHours" .

 Sharing  PBIX/some sample data and expected result to us  will make it easier to solve your problem.

 

BTY, The January CAP in the table  is 26 not 154, right?

 

Best Regards,
Community Support Team _ Eason

 

 

Anonymous
Not applicable

Hi,

 

Workinghours = Working days in month * hours per day

Working days in month = manually entered per month

hours per day = 7

 

CAP = sum(ResourceTimephasedDataSet[Capacity])

ResourceTimephasedDataSet[Capacity] = Column in Project Online which is linked to Power BI as Data Source
 
Here is the output I am expecting:
Year-MonthWorkinghoursCAP%age CAP
2020-011542617%
2020-021402115%

 

Hi , @Anonymous 

Try measures as below:

%age CAP = 
sumx(
    'Table',
    [CAP]/CALCULATE(MAX('Table'[Workinghours]))
)

Pbix attached

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

This works. Thanks a lot  🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.