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

Calculation of new customers with a rolling avarage

Hi,

I am trying to calculate new customers with an avarage sales of 150k. Below is my new customers calculation which works fine. What I couldnt do is to add a rolling avarage calculation to the new customers calculation  and filter new customers above 150k:

 

New Customers

VAR c =
MIN ( customer[salesdate] )
RETURN
COUNTROWS (
EXCEPT (
VALUES ( customer[id] ),
CALCULATETABLE (
VALUES ( customer[id] ),
ALLSELECTED ( customer ),
customer[salesdate] < c
)
)
)
 
Rolling Average Sales=
AVERAGEX(
FILTER(ALLSELECTED(customer[salesdate]),
customer[salesdate] <= MAX(customer[salesdate])),
[totalsales])
 
 
Thanks in advance for the answers!
5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Share some data and show the expected result.


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

Hello,

Thanks for asnwer.

I have a table as below.

Customer_idbilling_daterevenue
Whole Number datewhole number 

 

I need to calculate 2 conditions to decide customers current situation.

 

Condition A: checks whether the customer purchased in last 2 fiscal year.

Condition B: finds the last purchases in last 2 fiscal year and calculates an avarage. the avarage revenue per customer should be less than 100k

 

Flag: (yes or no) :if the condition A and Condition B is okey flag returns yes.

 

Thank you very much for help

@Ashish_Mathur 

Hi,

What is the span of the fiscal year.  If a user selects September 2020, then what should the beginning of the 2 year fiscal period be?


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

Hi,

Fiscal year starts with 1st of November. If the user selects September 2020 then the the code needs to check back to November 2018.

 

Thank you @Ashish_Mathur 

Hi,

Share the link from where i can download your PBI file.


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

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.

Top Solution Authors