cancel
Showing results 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.

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

 Compnay Page No Value DESIRED COLUMN A 2 30 35 A 2 40 35 B 2 30 40 B 2 40 40 B 3 50 40 C 1 10 15 C 1 20 15 C 3 20 15 C 3 10 15

1 ACCEPTED SOLUTION
Super User

Make Calculated Column I hope this will resolve the issue

Proud to be a Super User!

5 REPLIES 5
Super User

Proud to be a Super User!

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

Proud to be a Super User!

Frequent Visitor

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

Super User

Make Calculated Column I hope this will resolve the issue

Proud to be a Super User!

Frequent Visitor

Perfect, that's it.

Thank you very much @mh2587  appriciated.

Announcements

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

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors