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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kkalyanrr
Helper V
Helper V

Team avg vs individual avg

Hello,

I'm trying to put an chart with Individual Avg , team average(minus individual avg) and State average (minus selected individual and region he belongs).

Please help.

Arrow.PNG

1 ACCEPTED SOLUTION

Hello @kkalyanrr ,

Try the following steps:

State Average = 
VAR temp_table =
    SUMMARIZE (
        FILTER (
            ALLSELECTED( 'Table'[Emp ID]; 'Table'[Team]; 'Table'[State]; 'Table'[Revenue] );
            'Table'[Team] <> SELECTEDVALUE ( 'Table'[Team] )
                && 'Table'[State] = SELECTEDVALUE ( 'Table'[State] )
        );
        'Table'[State];
        "@RevenueTotal"; SUM ( 'Table'[Revenue] )
    )
RETURN
    AVERAGEX ( temp_table; [@RevenueTotal] )

Team Average = 
VAR temp_table =
    SUMMARIZE (
        FILTER (
            ALLSELECTED(  'Table'[Emp ID]; 'Table'[Team]; 'Table'[Revenue] );
            'Table'[Emp ID] <> SELECTEDVALUE ( 'Table'[Emp ID] )
                && [Team] = SELECTEDVALUE ( 'Table'[Team] )
        );
        'Table'[Team];
        'Table'[Revenue]
    )
RETURN
    AVERAGEX ( temp_table; 'Table'[Revenue] )

Check the result below and on the PBIX connection:

MFelix_0-1601630824481.png

Since T8 to T10 are only on the computer in a state the state values are not presented.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @kkalyanrr ,

 

Create the following 3 measures:

Individual Average = CALCULATE(AVERAGE('Table'[Revenue]); ALLSELECTED('Table'[Emp ID]))

State Average = 
VAR temp_table =
    SUMMARIZE (
        ALLSELECTED ( 'Table'[Team]; 'Table'[Emp ID]; 'Table'[State] );
        'Table'[State];
        "@StateRevenue"; SUM ( 'Table'[Revenue] )
    )
RETURN
    AVERAGEX ( temp_table; [@StateRevenue] )

Team Average = 
VAR temp_table =
    SUMMARIZE (
        ALLSELECTED ( 'Table'[Team]; 'Table'[Emp ID]; 'Table'[State] );
        'Table'[Team];
        "@TeamRevenue"; SUM ( 'Table'[Revenue] )
    )
RETURN
    AVERAGEX ( temp_table; [@TeamRevenue] )

 

this will return the averages for Individual, team and State then you can use them to make the calculations you need.

 

Check PBIx file attach.

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix  Thanks for the response.
I would like to see all the three lines in the same chart..

and if we select an individual id, we shld be able to see his performance,

his team performance(excluding his performace)

and his state performance(excluding his team performace).


Thanks.

Hello @kkalyanrr ,

Try the following steps:

State Average = 
VAR temp_table =
    SUMMARIZE (
        FILTER (
            ALLSELECTED( 'Table'[Emp ID]; 'Table'[Team]; 'Table'[State]; 'Table'[Revenue] );
            'Table'[Team] <> SELECTEDVALUE ( 'Table'[Team] )
                && 'Table'[State] = SELECTEDVALUE ( 'Table'[State] )
        );
        'Table'[State];
        "@RevenueTotal"; SUM ( 'Table'[Revenue] )
    )
RETURN
    AVERAGEX ( temp_table; [@RevenueTotal] )

Team Average = 
VAR temp_table =
    SUMMARIZE (
        FILTER (
            ALLSELECTED(  'Table'[Emp ID]; 'Table'[Team]; 'Table'[Revenue] );
            'Table'[Emp ID] <> SELECTEDVALUE ( 'Table'[Emp ID] )
                && [Team] = SELECTEDVALUE ( 'Table'[Team] )
        );
        'Table'[Team];
        'Table'[Revenue]
    )
RETURN
    AVERAGEX ( temp_table; 'Table'[Revenue] )

Check the result below and on the PBIX connection:

MFelix_0-1601630824481.png

Since T8 to T10 are only on the computer in a state the state values are not presented.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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