cancel
Showing results for
Search instead for
Did you mean:
Helper I

## Sum of subcategories in same table

Hi

I am looking to summerise the estimated worktime from diffrent assignments. My problem is that the time is registrede on a mixture of the main assignment and serval sub assignments. See example.

I can find the "Estimate" with the sum( function and the "Sub assignment estimate" by useing the "subassignment" number from the data set instead of "assignment" in the result table. But this solution doesn't allow me to add the data to the same table.

Does anyone know a function I can use to have both these numbers in the same table?

1 ACCEPTED SOLUTION
Community Support

Based on your description, I think you can create a calculated table as follows.

Result =
VAR x1 =
SUMMARIZE (
'Data',
Data[Assignment],
'Data'[Estimate],
"Sub assignment estimate",
SUMX (
FILTER ( ALL ( Data ), [Sub assignment] = EARLIER ( Data[Assignment] ) ),
[Estimate]
)
)
RETURN
FILTER (
ADDCOLUMNS ( x1, "total estimate", [Estimate] + [Sub assignment estimate] ),
[Sub assignment estimate] <> BLANK ()
)

Result:

Hope that's what you were looking for.

Best Regards,

Yuna

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

2 REPLIES 2
Community Support

Based on your description, I think you can create a calculated table as follows.

Result =
VAR x1 =
SUMMARIZE (
'Data',
Data[Assignment],
'Data'[Estimate],
"Sub assignment estimate",
SUMX (
FILTER ( ALL ( Data ), [Sub assignment] = EARLIER ( Data[Assignment] ) ),
[Estimate]
)
)
RETURN
FILTER (
ADDCOLUMNS ( x1, "total estimate", [Estimate] + [Sub assignment estimate] ),
[Sub assignment estimate] <> BLANK ()
)

Result:

Hope that's what you were looking for.

Best Regards,

Yuna

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

Super User II

Can you provide an example of wht you want your desired output to look like please? I'm struggling to visualise your requirements.

Pete

## Helpful resources

Announcements

#### Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

#### Check it Out!

Click here to read more about the April 2021 Updates!

#### Sign up for our May 4th event!

May the fourth be with you, join us online!

#### The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors