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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Julio-YYC
Helper II
Helper II

Calculating Average in Power BI

Hi There, 

I need help from the Experts on this request: 

- I have a table with columns Import Date, Name and Value (green table shown below) 

- I need to get a Measure to Calculate the 'average' of the column Value by Import Date/Name

- The gray table below shows the expected average value by Import Date/Name. As an example, Peter has 2 as the average and Amy has 3 as the average value on October 1st. 

 

I am not sure how to create this measure... 

 

JulioYYC_1-1668120866968.png

 

Thanks!

Julio

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Julio-YYC 

you can try to create a measure

Measure = CALCULATE(AVERAGE('Table'[value]),ALLEXCEPT('Table','Table'[Import Date],'Table'[Name]))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

@Julio-YYC 

you can try to create a measure

Measure = CALCULATE(AVERAGE('Table'[value]),ALLEXCEPT('Table','Table'[Import Date],'Table'[Name]))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi Ryan, thanks for the solution above. The measure worked perfectly for what I needed... I created it as a new column and told Power Bi to calculate the value as average. thanks for helping with that. 

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




MahyarTF
Memorable Member
Memorable Member

Hi,

You could use the below code for a created a new table :

NewTableName = SUMMARIZE(TableName,
                      TableName[Import Date],
                      TableName[Name],
                      "ValueAverage", AVERAGE(TableName[Value])
                    )
MahyarTF_0-1668127312682.png

 

Appreciate your Kudos and please mark it as a solution if it helps you.

 

Mahyartf

Hi Mahyar, 

Thanks for replying to my post. I tested the solution proposed by Ryan above, and the result cams satisfactory for me. I intend to use his measure in a line chart over time, which will work better for me. Apprciate your help also. We have a great community here always available to help... that's awesome! 

Julio

Also, you could create the Table Visual and select the Average Value for the specific Value field :

MahyarTF_1-1668127610535.png

 

Mahyartf

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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