Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
calexander1337
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
TomMartens
Super User
Super User

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

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
Navya_arun
New Member

It didn't work for my dataset

TomMartens
Super User
Super User

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

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany


@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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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