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
Anonymous
Not applicable

Urgent overall average by category

Hello guys!

 

I need to know how to calculate the overall average of categories grouped by IDs.

 

Description:

-Category A should return Points = 2 because there are 4 different IDs (8940,8930,8936 and 8939)

-Category B should return Points = 8 (3+5) because there are 2 different IDs (8285 and 8280)

-Category C should return Points = 9,5 (2,5+3+4) because there are 3 different IDs (8725,8745 and 8737)

 

Once the sums are calculated by categories, now I must sum all these values and divide by 3 (number of distinct categories).

 

Result = (2+8+9,5)/3 = 6,5 (I need this value)

 

PointsItem Idcategory
0,58940A
0,58930A
0,58936A
0,58939A
38285B
38285B
58280B
58280B
2,58725C
2,58725C
38745C
38745C
48737C
48737C
1 ACCEPTED SOLUTION
mwimberger
Resolver II
Resolver II

Hi @Anonymous 

 

Try this :

Create a summary table :

Summary Table =
SUMMARIZE (
    'Table',
    'Table'[category],
    'Table'[Item Id],
    "average of ID", AVERAGE ( 'Table'[Points] )
)

 

Then create a measure of the average of the sum of the averages:

Average of summary =
DIVIDE (
    SUM ( 'Summary Table'[average of ID] ),
    DISTINCTCOUNT ( 'Summary Table'[category] )
)

 

This will give you the result you're after:

result.jpg

View solution in original post

2 REPLIES 2
mwimberger
Resolver II
Resolver II

Hi @Anonymous 

 

Try this :

Create a summary table :

Summary Table =
SUMMARIZE (
    'Table',
    'Table'[category],
    'Table'[Item Id],
    "average of ID", AVERAGE ( 'Table'[Points] )
)

 

Then create a measure of the average of the sum of the averages:

Average of summary =
DIVIDE (
    SUM ( 'Summary Table'[average of ID] ),
    DISTINCTCOUNT ( 'Summary Table'[category] )
)

 

This will give you the result you're after:

result.jpg

Anonymous
Not applicable

Thanks a lot! It worked perfectly!!

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.