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

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.