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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.