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

Show average linked on last date

Hi guys,

 

simple, straightforward question. I have the following question:

 

CustomerProductSalesSellDate
AA3007/10/2018
AA4005/10/2018
BA2003/10/2018
BA3001/10/2018

 

I have calculated an average per customer. For example: Customer A has an average of (300 + 400) / 2 = 350 and B has (200/300) / 2 = 250.

 

Now I want to show the average linked to the last Selldate:

 

CustomerProductAvgSalesDate
AA3507/10/2018
BA2503/10/2018

 

 

Anyone some smart idea how to make linkage ?

 

1 ACCEPTED SOLUTION

@Anonymous

 

Please try the coding below. Thanks

 

average = CALCULATE(SUM('Sheet18'[sales]),FILTER(Sheet18,Sheet18[customer]=EARLIER(Sheet18[customer])))
date = MAXX(FILTER(Sheet18,Sheet18[customer]=EARLIER(Sheet18[customer])),'Sheet18'[selldate])

c1.JPG

 





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

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Vvelarde
Community Champion
Community Champion

@Anonymous

 

Hi, this is that you want?

 ImageImage

 

 




Lima - Peru
Anonymous
Not applicable

Hi 

 

 

 

 

CustomerProductSalesDate
AA3507/10/2018
BA2503/10/2018
  300Q4 2018

 

 

 

 

 

ryan_mayu
Super User
Super User

@Anonymous

 

I created a new table to get this result. Does this work for you?

table = SUMMARIZE(Sheet18,Sheet18[customer],Sheet18[product],"value",AVERAGE(Sheet18[sales]),"date",MAX('Sheet18'[selldate]))

 

c1.JPG





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

Proud to be a Super User!




Anonymous
Not applicable

Hi ryan,

 

that works perfect but would it possible to add it to the current table like that ?

 

CustomerProductSalesDateAvg SalesAvgDate
AA3007/10/20183507/10/2018
AA4005/10/20183507/10/2018
BA2003/10/20182503/10/2018
BA3001/10/20182503/10/2018

@Anonymous

 

Please try the coding below. Thanks

 

average = CALCULATE(SUM('Sheet18'[sales]),FILTER(Sheet18,Sheet18[customer]=EARLIER(Sheet18[customer])))
date = MAXX(FILTER(Sheet18,Sheet18[customer]=EARLIER(Sheet18[customer])),'Sheet18'[selldate])

c1.JPG

 





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

Proud to be a Super User!




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.