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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Best approach to obtain different level of averages

Hello everyone,

 

I'm a long time Excel user, rather at advanced level, however am rather new to PowerBI. I have been playing around my data but I am unsuccesful at obtaining what I need. I am truly sorry to be this demanding but I have stumbled upon my limit.

 

Context:

  • I am building a Dashboard to measure our performance/poductivity
  • It is realted to project management and based on Sprints

 

What I need:

  • Calculate the average productivity per person per sprint
  • Calculate the team average productivity per sprint
  • Calculate the best performer per sprint
  • Calculate the global average productivity of all time
  • Calculate the best performer of all time
  • We measure the productivity based on the Sum of Weight of Tasks / Quantity of Days Worked in the sprint

 

Data Structure:

  • Main source of information (contains most relevant information)
  • Working Days = a separate table that has the worked days by matching Assignee name and Sprint
  • Attached is a Pbix with my attempts to make it work and also a clean Pbix if anyone has a better approach.

 

What would be the best approach for this?

 

Many thanks to any help you can provide.

 

1 ACCEPTED SOLUTION
ERD
Community Champion
Community Champion

Hi @Anonymous,

I guess there are multiple options, but you can try the next approaches:

average_productivity = 
VAR _weight = SUM ( Data[Weight] )
VAR c_sprint = SELECTEDVALUE ( Data[Sprint Name] )
VAR w_days = CALCULATE ( SUM ( WorkingDays[Working Days] ), WorkingDays[Sprint] = c_sprint )
RETURN
    IF ( HASONEVALUE ( Data[Sprint Name] ) && HASONEVALUE(WorkingDays[Assignee Name]), _weight / w_days )
average_productivity_total = 
VAR empl_amt = DISTINCTCOUNT ( WorkingDays[Assignee Name] )
RETURN
    SUMX ( Data, [average_productivity] ) / empl_amt

ERD_0-1646673169613.png

best_performance = 
VAR t =
    ADDCOLUMNS (
        SUMMARIZE ( WorkingDays, WorkingDays[Assignee Name], WorkingDays[Sprint] ),
        "avgProductivity",
            VAR c_employee = CALCULATE ( SELECTEDVALUE ( WorkingDays[Assignee Name] ) )
            VAR c_sprint = CALCULATE ( SELECTEDVALUE ( WorkingDays[Sprint] ) )
            VAR _weight = CALCULATE (
                    SUM ( Data[Weight] ),
                    Data[Task Assignee Name] = c_employee,
                    Data[Sprint Name] = c_sprint
                )
            VAR w_days = CALCULATE ( SUM ( WorkingDays[Working Days] ), WorkingDays[Sprint] = c_sprint )
            RETURN
                _weight / w_days
    )
RETURN
    MAXX (
        FILTER ( t, [Sprint] IN VALUES ( Data[Sprint Name] ) ),
        [avgProductivity]
    )

ERD_1-1646673250418.png

average_productivity_all_time = CALCULATE( [average_productivity_total], ALL(Data[Sprint Name]))

ERD_4-1646673352126.png

best_performer (all time) = 
VAR t =
    ADDCOLUMNS (
        SUMMARIZE ( WorkingDays, WorkingDays[Assignee Name], WorkingDays[Sprint] ),
        "avgProductivity",
            VAR c_employee = CALCULATE ( SELECTEDVALUE ( WorkingDays[Assignee Name] ) )
            VAR c_sprint = CALCULATE ( SELECTEDVALUE ( WorkingDays[Sprint] ) )
            VAR _weight = CALCULATE (
                    SUM ( Data[Weight] ),
                    Data[Task Assignee Name] = c_employee,
                    Data[Sprint Name] = c_sprint
                )
            VAR w_days = CALCULATE ( SUM ( WorkingDays[Working Days] ), WorkingDays[Sprint] = c_sprint )
            RETURN
                _weight / w_days
    )
var maxV = MAXX ( t, [avgProductivity])
RETURN
    MAXX ( FILTER(t, [avgProductivity] = maxV), [Assignee Name] )

ERD_3-1646673326674.png

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

I am a Ukrainian living in Ukraine. Please, help us to survive! Please, Ask your government to react!
Here are official ways you can support us financially (accounts with multiple currencies):
https://bank.gov.ua/ua/about/support-the-armed-forces

USD:
BENEFICIARY: National Bank of Ukraine
BENEFICIARY BIC: NBUA UA UX
BENEFICIARY ADDRESS: 9 Instytutska St, Kyiv, 01601, Ukraine
ACCOUNT NUMBER: 400807238
BENEFICIARY BANK NAME: JP MORGAN CHASE BANK, New York
BENEFICIARY BANK BIC: CHASUS33
ABA 0210 0002 1
BENEFICIARY BANK ADDRESS: 383 Madison Avenue, New York, NY 10017, USA
PURPOSE OF PAYMENT: for crediting account 47330992708

Accounts details for other currencies (EUR|GBP|CHF|AUD|CAD|PLN) can be found here: https://bank.gov.ua/ua/about/support-the-armed-forces

 

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

View solution in original post

6 REPLIES 6
ERD
Community Champion
Community Champion

Hi @Anonymous,

I guess there are multiple options, but you can try the next approaches:

average_productivity = 
VAR _weight = SUM ( Data[Weight] )
VAR c_sprint = SELECTEDVALUE ( Data[Sprint Name] )
VAR w_days = CALCULATE ( SUM ( WorkingDays[Working Days] ), WorkingDays[Sprint] = c_sprint )
RETURN
    IF ( HASONEVALUE ( Data[Sprint Name] ) && HASONEVALUE(WorkingDays[Assignee Name]), _weight / w_days )
average_productivity_total = 
VAR empl_amt = DISTINCTCOUNT ( WorkingDays[Assignee Name] )
RETURN
    SUMX ( Data, [average_productivity] ) / empl_amt

ERD_0-1646673169613.png

best_performance = 
VAR t =
    ADDCOLUMNS (
        SUMMARIZE ( WorkingDays, WorkingDays[Assignee Name], WorkingDays[Sprint] ),
        "avgProductivity",
            VAR c_employee = CALCULATE ( SELECTEDVALUE ( WorkingDays[Assignee Name] ) )
            VAR c_sprint = CALCULATE ( SELECTEDVALUE ( WorkingDays[Sprint] ) )
            VAR _weight = CALCULATE (
                    SUM ( Data[Weight] ),
                    Data[Task Assignee Name] = c_employee,
                    Data[Sprint Name] = c_sprint
                )
            VAR w_days = CALCULATE ( SUM ( WorkingDays[Working Days] ), WorkingDays[Sprint] = c_sprint )
            RETURN
                _weight / w_days
    )
RETURN
    MAXX (
        FILTER ( t, [Sprint] IN VALUES ( Data[Sprint Name] ) ),
        [avgProductivity]
    )

ERD_1-1646673250418.png

average_productivity_all_time = CALCULATE( [average_productivity_total], ALL(Data[Sprint Name]))

ERD_4-1646673352126.png

best_performer (all time) = 
VAR t =
    ADDCOLUMNS (
        SUMMARIZE ( WorkingDays, WorkingDays[Assignee Name], WorkingDays[Sprint] ),
        "avgProductivity",
            VAR c_employee = CALCULATE ( SELECTEDVALUE ( WorkingDays[Assignee Name] ) )
            VAR c_sprint = CALCULATE ( SELECTEDVALUE ( WorkingDays[Sprint] ) )
            VAR _weight = CALCULATE (
                    SUM ( Data[Weight] ),
                    Data[Task Assignee Name] = c_employee,
                    Data[Sprint Name] = c_sprint
                )
            VAR w_days = CALCULATE ( SUM ( WorkingDays[Working Days] ), WorkingDays[Sprint] = c_sprint )
            RETURN
                _weight / w_days
    )
var maxV = MAXX ( t, [avgProductivity])
RETURN
    MAXX ( FILTER(t, [avgProductivity] = maxV), [Assignee Name] )

ERD_3-1646673326674.png

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

I am a Ukrainian living in Ukraine. Please, help us to survive! Please, Ask your government to react!
Here are official ways you can support us financially (accounts with multiple currencies):
https://bank.gov.ua/ua/about/support-the-armed-forces

USD:
BENEFICIARY: National Bank of Ukraine
BENEFICIARY BIC: NBUA UA UX
BENEFICIARY ADDRESS: 9 Instytutska St, Kyiv, 01601, Ukraine
ACCOUNT NUMBER: 400807238
BENEFICIARY BANK NAME: JP MORGAN CHASE BANK, New York
BENEFICIARY BANK BIC: CHASUS33
ABA 0210 0002 1
BENEFICIARY BANK ADDRESS: 383 Madison Avenue, New York, NY 10017, USA
PURPOSE OF PAYMENT: for crediting account 47330992708

Accounts details for other currencies (EUR|GBP|CHF|AUD|CAD|PLN) can be found here: https://bank.gov.ua/ua/about/support-the-armed-forces

 

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Anonymous
Not applicable

This helped me work on the right direction, had to make a few adjustments to some measures to find the right behaviour with filters. Amazing!!

Anonymous
Not applicable

Hi @amitchandak ,

 

Just tried it on several levels and obtained the following message:

 

The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.

@Anonymous ,share measure to check

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 

 

Productivity =
sum(Data[Weight])/
calculate(sum(WorkingDays[WorkingDays]);
ISINSCOPE(WorkingDays[Sprint]);
ISINSCOPE(WorkingDays[Working Days]))
amitchandak
Super User
Super User

@Anonymous , I think you need to use isinscope

 

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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