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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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