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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Calculating a group average from silcer

Hi!

Im still fairly new to using dax and power bi and im stuck on a calculation. 

I need a measure to calculate the average score of a unit when an individual from the unit is selected via slicer.

I have a measure for the individual that works:

AvgStars = AVERAGE(INSPECTION_RATING[CSAT_Inspector_Score])
Just stuck on how to get the unit average. I thought i could use SELECTEDVALUE somehow, but everything i've tried isnt working
 
If it helps my Tables are something like this:
 
 

Rating

Order_Id rating
15
22
31
43

 

Inspection

Order_Id Emp_ID
12
23
34
47

 

Inspector

Emp_ID  Unit_Num
220
320
430
770

 

Units

Unit_Num  Name
10texas
20michigan
30new york
70florida

 

 

Thanks for the help!

1 ACCEPTED SOLUTION
DataZoe
Employee
Employee

@Anonymous If you are trying to compare the individual to the individuals unit avg, you can try having a DAX measure that will ignore the individual slicer:

AvgStars_NotIndividual =
CALCULATE ( [AvgStars], REMOVEFILTERS ( 'Inspection'[Emp_ID] ) )

assuming 'Inspection'[Emp_ID] is the filter for individual.

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

2 REPLIES 2
DataZoe
Employee
Employee

@Anonymous If you are trying to compare the individual to the individuals unit avg, you can try having a DAX measure that will ignore the individual slicer:

AvgStars_NotIndividual =
CALCULATE ( [AvgStars], REMOVEFILTERS ( 'Inspection'[Emp_ID] ) )

assuming 'Inspection'[Emp_ID] is the filter for individual.

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Anonymous
Not applicable

This helped me a ton! and also I did discover that I needed to rearrange some of my relationships a little.  These combined helped me out.  Thanks again!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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