Skip to main content
cancel
Showing results for 
Search instead 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.

Reply
dpeacockTHH
Helper I
Helper I

Average of a measure

I'm hoping that I'm just completely missing something obvious here.  

I want to be able to pull an average of the last 5 days of CPD (which equals spend/download).  

 

dpeacockTHH_0-1647378188584.png

 

I'm pulling my hair out as this should be so simple but I cannot figure it out!  It looks like averages can only be done on a column.  The spend and download numbers come from 2 different tables:  Spend[spend] and Downloads[downloads].  The common fields that connect the tables are App and Date.

 

Any help would be appreciated as my brain is done.  I can't believe I can't figure out how to do an average.  SMH.

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @dpeacockTHH 

 

Try this measure:

Average CPD 5 Last Days = 
Var _Date = LASTDATE(Spend[Date])-4
Var _FT = FILTER(Spend,Spend[Date]>=_Date)
Var _New_Table = ADDCOLUMNS(_FT,"D",RELATED(Downloads[downloads]),"CPD",[Spend]/RELATED(Downloads[downloads]))
return
AVERAGEX(_New_Table,[CPD])

 

The sample file attached.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

 

View solution in original post

1 REPLY 1
VahidDM
Super User
Super User

Hi @dpeacockTHH 

 

Try this measure:

Average CPD 5 Last Days = 
Var _Date = LASTDATE(Spend[Date])-4
Var _FT = FILTER(Spend,Spend[Date]>=_Date)
Var _New_Table = ADDCOLUMNS(_FT,"D",RELATED(Downloads[downloads]),"CPD",[Spend]/RELATED(Downloads[downloads]))
return
AVERAGEX(_New_Table,[CPD])

 

The sample file attached.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

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

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.