cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

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
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
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

Super User II
Super User II

@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
Super User II
Super User II

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
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors