Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I am trying to do an average calculation of the count per location per grade, please help.
Solved! Go to Solution.
Hi @SebTsang
Try this code to build a calculated column.
Count Average Per Location and Grade =
CALCULATE (
AVERAGE ( 'Sample'[Count] ),
FILTER (
'Sample',
'Sample'[Location] = EARLIER ( 'Sample'[Location] )
&& 'Sample'[Grade] = EARLIER ( 'Sample'[Grade] )
)
)
Result is as below.
If you want a measure, you can try this code.
Measure =
CALCULATE (
AVERAGE ( 'Sample'[Count] ),
FILTER (
ALL('Sample'),
'Sample'[Location] = MAX ( 'Sample'[Location] )
&& 'Sample'[Grade] = MAX ( 'Sample'[Grade] )
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @SebTsang
Try this code to build a calculated column.
Count Average Per Location and Grade =
CALCULATE (
AVERAGE ( 'Sample'[Count] ),
FILTER (
'Sample',
'Sample'[Location] = EARLIER ( 'Sample'[Location] )
&& 'Sample'[Grade] = EARLIER ( 'Sample'[Grade] )
)
)
Result is as below.
If you want a measure, you can try this code.
Measure =
CALCULATE (
AVERAGE ( 'Sample'[Count] ),
FILTER (
ALL('Sample'),
'Sample'[Location] = MAX ( 'Sample'[Location] )
&& 'Sample'[Grade] = MAX ( 'Sample'[Grade] )
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @SebTsang ,
The best way is to use a measure just AVERAGE(Table[Column]) and then place the grades and the locaiton on your viusalization no need to create an additional column on your model.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português