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

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

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### New forum boards available in Real-Time Intelligence.

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

Top Solution Authors
Top Kudoed Authors