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
kconner77
Frequent Visitor

DAX (Power BI)- Averaging rates of children at a parent level

HI, looking for help creating an average of two children rates at a parent level. here is the data...

 

Campaign IDEmail IDPersonaSendsOpens
ABC1Teacher333111
ABC2Teacher222111
ABC3Teacher999111
ABC3Admin11150

 

If I wanted a 'Total Rate' for Campaign ABC, I'd total all opens & divide by all Sends (383/1665 = 23.0%), easy to do in DAX.

What I need for an 'Average Rate' is the average of the 3 open rates for the children (the 3 emails, 33%, 50%, 14.5%; average = 32.3%).

How can I use DAX for Power BI to do this, since the Average function requires a column?

 

Was trying Calculate, Group By, and Summarize, but cannot seem to get there. Advice?

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

These measures work

O = SUM(Data[Opens])
S = SUM(Data[Sends])
Measure = AVERAGEX(SUMMARIZE(VALUES(Data[Email ID]),Data[Email ID],"A",[S],"B",[O]),DIVIDE([b],[a]))

Ashish_Mathur_0-1711239967717.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

These measures work

O = SUM(Data[Opens])
S = SUM(Data[Sends])
Measure = AVERAGEX(SUMMARIZE(VALUES(Data[Email ID]),Data[Email ID],"A",[S],"B",[O]),DIVIDE([b],[a]))

Ashish_Mathur_0-1711239967717.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks, worked great. Appreciate the help.

lbendlin
Super User
Super User

You need to materialize the measure if you want the average of its values across groups.

 

lbendlin_0-1711231877528.png

Return Rate averaged = 
var a = ADDCOLUMNS(SUMMARIZE('Table',[Campaign ID],[Email ID]),"Ret",calculate([Return rate simple]))
return averagex(a,[Ret])

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.