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

How do I create an Average measure in Power BI

I have the table below in Power BI. The "popgrp" column goes from 1 to 6. How do I create a measure for the index such that will average the "INDEX" when I fiter by city and/or popgrp

 

Capture.PNG

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @Chuky01 ,

 

Do you want to display data like this?

 

H1.jpg

 

If yes, you can try @az38 's measure.

Or you can achieve this in Power Query Editor using the following steps.

 

1. Copy the table.

 

H2.jpg

 

2. Then group by the Table (2).

 

H3.jpg

 

3. At last, merge the Table.

 

H4.jpg

 

H5.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

View solution in original post

4 REPLIES 4
v-zhenbw-msft
Community Support
Community Support

Hi @Chuky01 ,

 

Do you want to display data like this?

 

H1.jpg

 

If yes, you can try @az38 's measure.

Or you can achieve this in Power Query Editor using the following steps.

 

1. Copy the table.

 

H2.jpg

 

2. Then group by the Table (2).

 

H3.jpg

 

3. At last, merge the Table.

 

H4.jpg

 

H5.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

az38
Community Champion
Community Champion

@Chuky01 hi

try

Measure = 
CALCULATE(AVERAGE(Table[INDEX]), FILTER(ALLSELECTED('Table'), Table[popgrp] = MAX(Table[popgrp])) )

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anand24
Super User
Super User

Hi @Chuky01 ,

Can you simply create a new measure with DAX using Average function:

New Measure = AVERAGE('TableName'[INDEX])

 

You can also put summarization as 'Average' for INDEX column when you pull it in your visualizations.

avg.PNG

 

Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!! 

@Anand24 Thanks for the response, though it does not seem to be working.  It showes the average of all the rows even when I filter by state or popgrp

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.