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
usmanrafiq
Helper I
Helper I

Average of Other Users

Hello,

 

I have table which have user ID projectID  they worked on  and Time Spent

 

like this (sample data)

 

UserID Project ID Time Spent
115
213
315
414

 

I have created a report which have users ID as page filter 

 

How to create a clustered bar chart which shows that specific user ID spent time in one bar and shows AVG(other users spent time) in another bar 

 

 

 

 

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@usmanrafiq 

 

You can create a measure to calculate other users' average spend time.

 

Measure = 
VAR selecteduser = SELECTEDVALUE(user[UserID ])
return AVERAGEX(FILTER(all(user),user[UserID ]<>selecteduser),user[Time Spent])

1.PNG

 

 





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

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

@usmanrafiq 

 

You can create a measure to calculate other users' average spend time.

 

Measure = 
VAR selecteduser = SELECTEDVALUE(user[UserID ])
return AVERAGEX(FILTER(all(user),user[UserID ]<>selecteduser),user[Time Spent])

1.PNG

 

 





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

Proud to be a Super User!




Can i also use it by Projects

 

like 

 

USer 1 Project 1 Hours  VS  Other Users Project 1 Hours (Avg)

USer 1 Project 2 Hours  VS  Other Users Project 2 (AVG)

@usmanrafiq 

 

Maybe something like below. you can have a try.

 

Measure = 
VAR selecteduser = SELECTEDVALUE(user[UserID ])
VAR selectedproject = SELECTEDVALUE(user[projectID])
return AVERAGEX(FILTER(all(user),user[UserID ]<>selecteduser && user[projectID]<>selected project),user[Time Spent])

 

 





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

Proud to be a Super User!




amitchandak
Super User
Super User

@usmanrafiq , You have created a clustered line chart where for line you use a measure like this

 

Avg = Average(allselected(Table[user]),[Time Spent])

better to a seprate user table

 

Avg = Average(all(User[user]),[Time Spent])

can you provide your power bi file so that i can look at the example

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.