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
AndreaPRJ
Helper I
Helper I

Calculation for new customer sales

Good morning everyone.

I would need to show both the number of new customers and their sales through two cards.

Given that the criterion by which it is determined that a customer is new is the following:

If in the previous year (e.g. 2021) he has not bought anything and instead in the current year (e.g. 2022) he bought something, then it is a new customer!

The calculation must also be sensitive to the chosen month (because I would like to be able to make an analysis, for example, limiting it to only until 31 August of this year and therefore the customers considered new will be those who in ALL 2021 had not bought anything, but who instead, on 31 August of the last year, 2022, instead bought something.

I would like to give the user the possibility to choose, through two filters, both the years and the months:

The minor year (e.g. 2021) will always be considered ALL for the measures of the calculation of the number of customers and their sales, while the higher one (eg: 2022), will be considered only up to the month chosen by the user.

 

My idea was to create a calculated table, to be used later in my measures, where I already summarize the sales per year per customer. Within this summarize I then wanted to put a filter for the date (ex: min of 07/31/2022), but I do not accept the measures! so it works..but with the date written in a "hardcoded" way ..

 

See attached files for details

 

if i can't use a measure in the Calculatedtable, how can i pass the date chosen by the user through the filters dynamically?

Thanks in advance very much

ps: the errors in the code you see (underlining) are there because I renamed the tables in such a way that the names could be understood ...

Immagine 2022-09-15 111245.jpg

 

Immagine 2022-09-15 111825.jpg

 

1 ACCEPTED SOLUTION
daXtreme
Solution Sage
Solution Sage
1 REPLY 1
daXtreme
Solution Sage
Solution Sage

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