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
rush
Helper V
Helper V

Identify New Clients at any time based on a rolling 12 months prior

Hi

 

Please assit with the issue below I have.

 

I currently have a measure below that calculates new clients based on their last date billed but would like to have it dynamic in the sense that I can select a month in the past and it would give me a list of new clients.

 

A new client is defined as someone that we have not billed in 12 months prior to their last date billed.

 

I managed to create a static measure that will give me the result I need but would like for it to be automated on any particular month / year I select.

For April 2018, it would look back 12 months from that period to see if any billing was generated, if not, it would mark it as a 1.

 

Please find link to sample data below:

 

Sample Data

 

New Clients for March 2018 PR = 

VAR Rev_prior_to_last_billing_period = CALCULATE ( [Total Billing PR] , 
Dim_Date[Date_Key] >= 20170301 && Dim_Date[Date_Key] <= 20180228) VAR Rev_for_March_2018 = CALCULATE ( [Total Billing PR] , Dim_Date[Date_Key] >= 20180301 && Dim_Date[Date_Key] <= 20180331) RETURN IF ( AND ( Rev_prior_to_last_billing_period = 0 , Rev_for_March_2018 > 0 ) , 1 , 0 )

New Clients for April 2018 = 
VAR Rev_prior_to_last_billing_period = CALCULATE ( [Total Billing PR] ,
Dim_Date[Date_Key] >= 20170401 && Dim_Date[Date_Key] <= 20180331) VAR Rev_for_April_2018 = CALCULATE ( [Total Billing PR] , Dim_Date[Date_Key] >= 20180401 && Dim_Date[Date_Key] <= 20180430) RETURN IF ( AND ( Rev_prior_to_last_billing_period = 0 , Rev_for_April_2018 > 0 ) , 1 , 0 )
1 ACCEPTED SOLUTION

Hi @rush,

 

Please download the demo in the attachment. Please use this measure. I also create a measure to verify the result

If New Clients =
VAR Rev_prior_to_last_billing_period =
    CALCULATE (
        SUM ( 'Table1'[Total Billing PR] ),
        DATESINPERIOD (
            'Dim_Date'[Date_Key],
            MIN ( 'Dim_Date'[Date_Key] ) - 1,
            -12,
            MONTH
        )
    )
VAR Rev_for_current =
    SUM ( 'Table1'[Total Billing PR] )
RETURN
    IF ( AND ( Rev_prior_to_last_billing_period = 0, Rev_for_current > 0 ), 1, 0 )

Identify-New-Clients-at-any-time-based-on-a-rolling-12-months-prior2

 

Best Regards,
Dale

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

View solution in original post

4 REPLIES 4
v-jiascu-msft
Employee
Employee

Hi @rush,

 

I would suggest you create an independent Date table and establish relationships. The measure could like this. The visual could like the one in the snapshot, which has Date and custom context in your scenario.

New Clients for April 2018 =
VAR Rev_prior_to_last_billing_period =
    CALCULATE (
        [Total Billing PR],
        DATESINPERIOD ( 'DimDate'[Datekey], MAX ( 'DimDate'[Datekey] ), -12, MONTH )
    )
VAR Rev_for_April_2018 = [Total Billing PR]
RETURN
    IF (
        AND ( Rev_prior_to_last_billing_period = 0, Rev_for_April_2018 > 0 ),
        1,
        0
    )

Identify-New-Clients-at-any-time-based-on-a-rolling-12-months-prior

If you still have issues, please provide a dummy sample.

 

Best Regards,
Dale

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

Hi @v-jiascu-msft

 

Thank you for the suggestion but the measure does not work.

 

Please find link to sample data below:

 

Sample Data

Hi @rush,

 

Please download the demo in the attachment. Please use this measure. I also create a measure to verify the result

If New Clients =
VAR Rev_prior_to_last_billing_period =
    CALCULATE (
        SUM ( 'Table1'[Total Billing PR] ),
        DATESINPERIOD (
            'Dim_Date'[Date_Key],
            MIN ( 'Dim_Date'[Date_Key] ) - 1,
            -12,
            MONTH
        )
    )
VAR Rev_for_current =
    SUM ( 'Table1'[Total Billing PR] )
RETURN
    IF ( AND ( Rev_prior_to_last_billing_period = 0, Rev_for_current > 0 ), 1, 0 )

Identify-New-Clients-at-any-time-based-on-a-rolling-12-months-prior2

 

Best Regards,
Dale

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

@v-jiascu-msftThank you very much. It works well based on a selected period.

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.