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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
RichardTam
Helper I
Helper I

Filter a value from slicer to find the average

Lets say I have a staff query:

StaffSub type
ASales
BSales
CBack Office
DBack Office
ESales

 

And I have a task table:

Task IDCreated DateCreated byFinished by
11/07/2020AB
22/07/2020BB
32/07/2020AC
44/07/2020CA
54/07/2020DA
68/07/2020BD
78/07/2020AA
88/07/2020DC
910/07/2020EC
1012/07/2020ED

 

Each staff creates and finish some tasks. I am now trying to look at reports of each staff
So the report will have a slicer for staff (ie Staff B)
and 2 charts will show me the number of tasks created and finished by B

Right now I am trying to add in an average for the two charts,
so I can see the average of the group, ie how many jobs was created from sales, quick calculation can filter a particular Sub type or Staff, how to make it read whatever from the slicer?

Many thanks

5 REPLIES 5
danielkrol
Helper II
Helper II

Well, since the model of your data is not completely clear to me (are there any relations?) it is a bit a throw in the dark, but I think that creating a measure like this will do...

Finished = 
    CALCULATE( COUNT( Task[Task ID] ),
        FILTER( ALL( Task[Finished by] ),
            Task[Finished by]=SELECTEDVALUE( Staf[Staff] )
        )
    )

 

 

Of course, this measure will only get you the number of finished tasks by a staff id. You have to create a measure for started tasks as well, but that is more or less teh same as this slicer, but then with other collum names.

I understand the formula, but I am trying to find the average of that staff type.
say the slicer selected "A"
I would like to see the average number of task created by sales

Something like this?

avFinished = 
VAR stafCount = CALCULATE( COUNT( Task[Task ID] ),
        FILTER( ALL( Task ),
            Task[Finished by]=SELECTEDVALUE( Staf[Staff] )
        )
    )
VAR totalCount = CALCULATE( COUNT( Task[Task ID] ),
        FILTER( ALL( Task ),
            TRUE()
        )
    )
RETURN DIVIDE(stafCount,totalCount,BLANK())

 

If not, meaby you can post your pbix file?

I have a list of staff to choose in the slicer, they all belong to one of four sub type.
I just want to get an average of the sub type, over each month, compare to the actual performance of that staff

Untitled.png

 

So I would like the total of Sub type 1 to be added into the chart

amitchandak
Super User
Super User

@RichardTam , Created by and  Finished by to staff in staff query. One will active and another one will be inactive. Use userelation to activate other

Refer use relation example here: https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

or

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

 

 

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.