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
rax99
Helper V
Helper V

Compare your score against your team/ Department/ Org etc

Sorry guys Im a bit of a newb to this PBI stuff. Havent seen this question answered in this specific context.

 

So here are a few rows from the dummy Table1:

 

SalesIDDateAgentIdPrimary_SkillSub_SkillQualitySatisfactionPerm RevTemp RevTeamIDDeptIDOrg
115268486201ICRComm50733.6869.15T3D2WM
215263841772ICRComm5284.3028.82T2D1WM
315260216743ICRResi21744.6335.43T3D2WM
415261109884ICRResi59750.039.41T3D2WM
515263536955ICRComm62950.8412.36T1D1WM
615275993166ICRComm88630.8045.97T4D1WM
715255867527ICRComm14953.0884.90T1D1WM
815275521568ICRResi24980.8069.96T2D2WM
915254993269ICRResi56985.003.58T3D2WM
10152566080410ICRResi41428.3625.45T3D1WM
11152652415211ICRResi10533.9169.45T4D1WM
12152642473712ICRResi1847.9047.24T3D1WM
13152773988513ICRResi15844.5842.44T2D2WM
14152642672714ICRComm68278.3681.72T3D1WM
15152677826115ICRComm7980.0542.79T2D2WM
16152745728316ICRResi93826.2142.97T1D2WM
17152539797817ICRComm8496.464.36T4D2WM
18152562481418ICRResi41458.0927.40T3D1WM
19152621329019ICRResi15870.6699.78T3D1WM
20152757341120ICRComm35919.8942.19T1D2WM
            

 

So what I need is a calc to evaluate an individuals Avg Quality score against the Team he is in. And also a calc to compare against the Dept. And one for the org. 

 

EG, compare AgentID=1 against his Team of TeamID = T3.

 

Ive tried using something like:

AvgDeptQualityScoreComp = CALCULATE(AVERAGE(Table1[Quality]),ALL(Table1), Table1[TeamID])  - but it doesnt like the last filter as its looking for an explicit value or T/F.

 

I dont want the give TeamID a specific value as this will need to change depending on the AgentID filtered on the page.

 

2 REPLIES 2
Anonymous
Not applicable

Hi, this should do what you're after, it will only return a value when there is a filter applied to the agent id column. Let me know if it helps!

 

Team Average =  
   VAR Team =
        MAX ( Sales[TeamID] )
    RETURN
        IF (
            ISFILTERED ( Sales[AgentId] ),
            CALCULATE ( AVERAGE ( Sales[Quality] ), Sales[TeamID] = Team ),
            BLANK ()
        )
Department Average =  
   VAR Department =
        MAX ( Sales[DeptID] )
    RETURN
        IF (
            ISFILTERED ( Sales[AgentId] ),
            CALCULATE ( AVERAGE ( Sales[Quality] ), Sales[DeptID] = Department ),
            BLANK ()
        )

 

This didnt appear to wrk. But  think it could be an issue with my dataset. I have redone the data structure and will repost the question. However thanks for your help, and apologies.

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.

Top Solution Authors