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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
acaryasin01
Frequent Visitor

How to calculate average of a column by multiple group as a new column?

Hi guys,

 

If I have a data table like below,

How can I create a new column (below DESIRED COLUMN) which is calculated by Value grouped by Company's page no as an average. for each row.

 

How can get Average of Value for each page. returning value must be in every its row.

I wrote this dax but It returned average of Page no?!

But it returns same value for all rows.

Average of Same page's value = AVERAGEX(AEX , IF(EARLIER(AEX[pageno]) = AEX[pageno] , 1 , 0))
 
CompnayPage NoValueDESIRED COLUMN
A23035
A24035
B23040
B24040
B35040
C11015
C12015
C32015
C31015

 

1 ACCEPTED SOLUTION

cc.PNG

Make Calculated Column I hope this will resolve the issue


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



View solution in original post

5 REPLIES 5
mh2587
Super User
Super User

zc.PNG


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



mh2587
Super User
Super User

Avg By Group = CALCULATE(AVERAGE(Sheet1[Value]),FILTER(Sheet1,Sheet1[Compnay] in {"A","B","C"}))

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Thank you four you answer @mh2587 ,

 

I need these average value in all rows as a new column.

And also I have more than 70 company names, so I need more simple DAX.

 

Kind regards...

cc.PNG

Make Calculated Column I hope this will resolve the issue


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Perfect, that's it.

 

Thank you very much @mh2587  appriciated.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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