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
Anonymous
Not applicable

Average on average aggregation

Hi All, 

 

I am trying to do the average of "Time Spent on Page" by Session ID. Once this is done, I need to show the overall average. Here is an example. All I need to report on my dashboard is 3.6 minutes. I am very new to PBI, any insights you could provide is greatly appreciated. Fyi, I do not need to create that second table at all, I need to work off of my original data only and need to report on overall average which is 3.6

 

AshwiniBende_0-1643129095541.png

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

please check the below picture and the attached pbix file.

 

Picture1.png

 

Result measure: =
VAR newtable =
ADDCOLUMNS (
SUMMARIZE ( Data, Data[Session ID] ),
"@avgpersession", CALCULATE ( AVERAGE ( Data[Minute duration] ) )
)
RETURN
AVERAGEX ( newtable, [@avgpersession] )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

6 REPLIES 6
JGARROD
Helper I
Helper I

Hi, i was wondering how you would do this with a 3rd level, so ive managed to relicate as mentioned above but i need to do the following:

 

Level 1 figures (averaged = Level 2) > Level 2 figures (averaged = Level 3) > Level 3 averaged figures gives overall score - how would i acomplish this?

 

It seems by following this method i would need to nestle a VAR table within a VAR table? any help would be much appreciated. 

Jihwan_Kim
Super User
Super User

Hi,

please check the below picture and the attached pbix file.

 

Picture1.png

 

Result measure: =
VAR newtable =
ADDCOLUMNS (
SUMMARIZE ( Data, Data[Session ID] ),
"@avgpersession", CALCULATE ( AVERAGE ( Data[Minute duration] ) )
)
RETURN
AVERAGEX ( newtable, [@avgpersession] )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

Quick follow up on this. I am getting the below error when I used the same formula with in a report where DirectQuery is used instead of import. Is there any workaround for this?

 

AshwiniBende_0-1644937377000.png

 

Anonymous
Not applicable

Thank you so much for your quick response. It worked.

Richard_100
Resolver I
Resolver I

Hello

 

This should work:

 

 

 

[AVG of AVG] =

VAR _Prep = SUMMARIZE(Table1, Table1[Session ID], "@AVG", AVERAGE(Table1[Overall Session Duration (Minutes)]))

RETURN AVERAGEX(_Prep, [@AVG])

 

 

Where Table1 is the name of your original data table.  _Prep is a variable that acts as the equivilent of your table from the right of your screenshot, providing the average for the Session ID in your visual; the AVERAGEX then averages over that

 

 

Hope that helps. 

 

Regards

Richard

 

Regards

Richard

Anonymous
Not applicable

Thank you

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors