Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Identify new Customers

Hi,

 

I have a list of sales by customer and by week. I'd like to identify how many new customers I have each week. In my database, I have data for last 3 years, howerver, I want to apply the formula only to the data that is after 12th week of this year.

Below is an example of the result data.

 

WeekCustomerNew?
12Customer1yes
12

Customer2

yes

13Customer3yes
13Customer4yes
13Customer1no
14

Customer2

no

14Customer3

no

14Customer4no
15

Customer5

yes

15Customer6yes
16Customer1no

 

Thanks.

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could also use DAX to create a new column.

Column =
VAR a =
    RANKX (
        FILTER (
            'Table',
            'Table'[Customer] = EARLIER ( 'Table'[Customer] )
                && 'Table'[Week] >= 12
        ),
        'Table'[Week],
        ,
        ASC,
        DENSE
    )
RETURN
    IF ( a = 1, "yes", "no" )

Here is the result.

3-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Works Perfectly. Thanks for the solution

 

Anonymous
Not applicable

@v-eachen-msft  Thanks.
This works but it takes the full database (all 3 years). I'd like to apply this only for this year.
I have applied this as a filter, but it still didn't work as expected.

Below is an example of how the visual is filtered

9G_0-1594296942871.png


Thanks.

camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Check this code for a new column:

let
_customer = [Customer],
_currentWeek = [Week]
in
if _currentWeek = List.Min(Table.SelectRows(#"Changed Type", each [Customer] = _customer and [Week] >= 12)[Week]) then "Yes" else "No"

 

Capture.PNG

 

Just change the bold part for your last step name.



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

Proud to be a Super User!



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors