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
Anonymous
Not applicable

Need help with calculations

Hello,

I am very new in PowerBI and I need help with calculations.

From the table below (this is a small part of the table)

PowerBI.jpg

From this table, I need to calculate total hours per Project_ID based on Task_ID planned hours. The difficult part for me is that Task_ID with the same name should be included once in the hour's calculation for Project_ID. I mean that for instance for Project_1 final result should be 15hours instead of 70hours. And also I need to calculate total progress for the Project_ID issue here is that some fields are missing value. So how can I ignore it or include as 100% in the calculation?

Thank you in advance.

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

Hi @Anonymous ,

 

For your first requirement, you need to create two measures.

AVG =
CALCULATE ( AVERAGE ( 'Table'[Planned Hours] ) )
TotalHours =
SUMX ( VALUES ( 'Table'[Task ID] ), [AVG] )

Then you can use Project ID and TotalHours to get a visual.3-1.PNG

For your second requirement, I do not understand the logic of your column “Progress”. Maybe you can provide more information.

 

Best Regards,

Eads

 

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

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

For your first requirement, you need to create two measures.

AVG =
CALCULATE ( AVERAGE ( 'Table'[Planned Hours] ) )
TotalHours =
SUMX ( VALUES ( 'Table'[Task ID] ), [AVG] )

Then you can use Project ID and TotalHours to get a visual.3-1.PNG

For your second requirement, I do not understand the logic of your column “Progress”. Maybe you can provide more information.

 

Best Regards,

Eads

 

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

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

Hi @v-eachen-msft 

Thank you very much for your help. Your solution works perfectly.

Now I will try to clarify the second part.

Progress column shows how progress increased after every attempt to the task.

For example for Task_1 in Project_1 final progress is unknown because we are missing value from the last attempt, however, we know that it is not less than 80%.

If we are missing 100% value can we use second-biggest? because here is important the biggest value in progress per task.

Thank you very much.

Have a nice weekend. 

 

Hi @Anonymous ,

 

According to your thinking, the method is actually the same as above.

Firstly, you need to create a new column "Progress Hours" to calculate the value of progress.

Progress Hours =
'Table'[Planned Hours]
    * IF (
        'Table'[Progress] <> BLANK (),
        VALUE ( LEFT ( 'Table'[Progress], LEN ( 'Table'[Progress] ) - 1 ) ) / 100,
        0
    )

Create two measures.

MAX =
CALCULATE ( MAX ( 'Table'[Progress Hours] ) )
TotalProgressHours =
SUMX ( VALUES ( 'Table'[Task ID] ), [MAX] )

Then you can get the final visual with Project_ID and TotalProgressHours.Capture.PNG

 

Best Regards,

Eads

 

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

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

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.