cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

## Summarizing two columns, Dividing them within a group

Hi all,

I'm unsure of how to phrase what I need, so I'll first attach an image of the desired result below:

Bold = Column Name

Italic = Record

This is my Competency Requirement table.  I want to be able to summarize the QTY Completed column grouped by each Competency, and then take that sum and divide it by the sum of the QTY Needed column.  The desired result is the % Completed column.

Using this image as an example, I summarized the QTY Completed for Requirement A and Requirement B where the Competency is Gold App Dev, and then divided that number by the QTY Needed for Requirement A and Requirement B where the Competency is Gold App Dev as well.

I know two summarizations with a division within a group by is not easy, and I appreciate any help that can be offered!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: Summarizing two columns, Dividing them within a group

Hey,

I created this measure:

Measure =
CALCULATE(
SUMX(
VALUES('Table1'[Competency])
, var completed = CALCULATE(SUM(Table1[QTY Completed]))
var needed = CALCULATE(SUM(Table1[QTY Needed]))
return
DIVIDE(completed , needed)
)
,ALL(Table1[Requirement])
)

Based on your sample data I can now create this table visual:

Hopefully this is what you are looking for.

Regards,

Tom

Hamburg - Germany
Proud to be a Datanaut!
2 REPLIES 2
Super User

## Re: Summarizing two columns, Dividing them within a group

Hey,

I created this measure:

Measure =
CALCULATE(
SUMX(
VALUES('Table1'[Competency])
, var completed = CALCULATE(SUM(Table1[QTY Completed]))
var needed = CALCULATE(SUM(Table1[QTY Needed]))
return
DIVIDE(completed , needed)
)
,ALL(Table1[Requirement])
)

Based on your sample data I can now create this table visual:

Hopefully this is what you are looking for.

Regards,

Tom

Hamburg - Germany
Proud to be a Datanaut!
Frequent Visitor

## Re: Summarizing two columns, Dividing them within a group

@TomMartens wrote:

Hey,

I created this measure:

Measure =
CALCULATE(
SUMX(
VALUES('Table1'[Competency])
, var completed = CALCULATE(SUM(Table1[QTY Completed]))
var needed = CALCULATE(SUM(Table1[QTY Needed]))
return
DIVIDE(completed , needed)
)
,ALL(Table1[Requirement])
)

Based on your sample data I can now create this table visual:

Hopefully this is what you are looking for.

Regards,

Tom

Thanks a bunch!!

Announcements

#### Community Highlights

Find out what's new in the Power BI Community!

#### Power Platform Summit North America

Register by September 5 to save \$200

#### Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 314 members 3,351 guests
Recent signins: