cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper IV

## Sum hours only once per document by priority

I have three tables as below. in the middle table I want to see the man hour only is shown once per document in the report and is shown against the line which has the highest priority, 1.

For example Doc1 has been repeated multiple times in the middle table. However I want to see the hours for WP1 which has priority1

Any idea how this can be done?

6 REPLIES 6
Helper IV

The target is that, each Doc man hour only get reflected in WP table once.

priority has 1 to many relationship with workpack. each workpack has only one priority.

There are many workpacks with priority 1 or priority 2 . and each document may get repeated multiple time in the middle table against different work pack. However, I want the man hour for each document only get reflected once in the middle table and against the workpack which has the lowest priority. Hope I answered your question

Super User

I created a calculated column to get the desired results, please check.

``````Result =
IF(
CALCULATE( MIN( Table31[Priority] ) , ALLEXCEPT( Table31 , Table31[Doc List] ) ) = Table31[Priority] &&
CALCULATE( MIN( Table31[Work pack] ) , ALLEXCEPT( Table31 , Table31[Doc List] ) ) = Table31[Work pack],
RELATED(Table32[Ramaining Hours])
)``````

Did I answer your question? Mark my post as a solution! and hit thumbs up
Helper IV

The result comes blank in the below case.

Min1 is your formula first part, Min2 is your formula second part. there is no record with both to be True. So, it comes blank result.

I do understand min1 which check the lowest priority. However, I dont understand what is the second Min. WP is a text column. I expect to see the result against one of the top 4 priority order 6 (does not matter which one.

Super User

It seems you're referring to a situation where there's a need to calculate results when the document list and priorities are the same, like Doc 2 and Priority 2. In this scenario, you don't want to display the remaining hours for both WP2 and WP3.

In this case, since Doc 2 and Priority 2 are the same, we want to show only one entry. We can use a function, let's say MIN, to pick one of the remaining hours

Did I answer your question? Mark my post as a solution! and hit thumbs up
Helper IV

it only needs the first Min function which picks the minimum priority, then from the result should pick one of them (it does not matter which one, However it hsould only be one and for the rest "the remaining man hour to be zero). Min of work pack in my view is not required. ANy idea which function can be used to pick only one from the first Min function?

Super User

How to handle it for Doc 2 where the priority (2)  appears twice, in this case the difference the Work Pack. How to identify which work pack to consider first?

Did I answer your question? Mark my post as a solution! and hit thumbs up

Announcements

#### Fabric certifications survey

Certification feedback opportunity for the community.

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors