cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
calexander1337 Frequent Visitor
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

 

helpme.PNG

 

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 III
Super User III

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:

image.png

Hopefully this is what you are looking for.

 

Regards,

Tom

 

 

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
I accept Kudos :-), If you find my post helpful.

Proud to be a Datanaut!

View solution in original post

2 REPLIES 2
Super User III
Super User III

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:

image.png

Hopefully this is what you are looking for.

 

Regards,

Tom

 

 

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
I accept Kudos :-), If you find my post helpful.

Proud to be a Datanaut!

View solution in original post

Highlighted
calexander1337 Frequent Visitor
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:

image.png

Hopefully this is what you are looking for.

 

Regards,

Tom

 

 


Thanks a bunch!! 

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors