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
kiranch
Regular Visitor

How to calculate New Members and renuals based on Below scenario

Hi Team,

 

I need to do the calculation based on Below  Scenario, Can you Please help me to resolve this.

 

kiranch_0-1653636925574.png

 

 

Regards,

Kiran

 

1 ACCEPTED SOLUTION
v-xiaoyan-msft
Community Support
Community Support

Hi @kiranch ,

 

You can meet your needs by the following measures:

Status =
VAR _count =
    CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[Customer ID] ) )
VAR _last =
    MAXX (
        FILTER ( ALL ( 'Table' ), [Customer ID] = MAX ( 'Table'[Customer ID] ) ),
        [Start Date]
    )
RETURN
    IF (
        _count > 1
            && CALCULATE (
                MAX ( 'Table'[End Date] ),
                FILTER (
                    'Table',
                    [Customer ID] = MAX ( 'Table'[Customer ID] )
                        && [Start Date] = _last
                )
            )
                = BLANK (),
        "Renewal",
        "New Member"
    )

 

 

Count of New =
VAR _t =
    SUMMARIZE ( 'Table', [Customer ID], "Status", [Status] )
RETURN
    COUNTROWS ( FILTER ( _t, [Status] = "New Member" ) )

 

 

Count of Renewal =
VAR _t =
    SUMMARIZE ( 'Table', [Customer ID], "Status", [Status] )
RETURN
    COUNTROWS ( FILTER ( _t, [Status] = "Renewal" ) )

 

Then you can get a result like:

 

vcaitlynmstf_0-1654154267654.png

 

A demo for your reference is attched below.

 

Hope it helps,

Best Regards,
Community Support Team _ Caitlyn

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

3 REPLIES 3
v-xiaoyan-msft
Community Support
Community Support

Hi @kiranch ,

 

You can meet your needs by the following measures:

Status =
VAR _count =
    CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[Customer ID] ) )
VAR _last =
    MAXX (
        FILTER ( ALL ( 'Table' ), [Customer ID] = MAX ( 'Table'[Customer ID] ) ),
        [Start Date]
    )
RETURN
    IF (
        _count > 1
            && CALCULATE (
                MAX ( 'Table'[End Date] ),
                FILTER (
                    'Table',
                    [Customer ID] = MAX ( 'Table'[Customer ID] )
                        && [Start Date] = _last
                )
            )
                = BLANK (),
        "Renewal",
        "New Member"
    )

 

 

Count of New =
VAR _t =
    SUMMARIZE ( 'Table', [Customer ID], "Status", [Status] )
RETURN
    COUNTROWS ( FILTER ( _t, [Status] = "New Member" ) )

 

 

Count of Renewal =
VAR _t =
    SUMMARIZE ( 'Table', [Customer ID], "Status", [Status] )
RETURN
    COUNTROWS ( FILTER ( _t, [Status] = "Renewal" ) )

 

Then you can get a result like:

 

vcaitlynmstf_0-1654154267654.png

 

A demo for your reference is attched below.

 

Hope it helps,

Best Regards,
Community Support Team _ Caitlyn

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

kiranch
Regular Visitor

Hi @v-xiaoyan-msft ,

 

Thanks for the reply,

I want to find the New customers and Renewal customers Based on the Below data,

If you check the data , customerID 1000001,100002 are renewal customers and 1000003 is New Customer.

Here Total Customers are 3 and Renewal Customers are  2 and New customer is 1

 

kiranch_0-1653897150964.png

 

 

Regards,

Kiran

 

v-xiaoyan-msft
Community Support
Community Support

Hi @kiranch ,

 

I may not quite understand what you mean, is the information you provided above your sample data? Could you explain your requirements in more detail, it would be nice to have more information about what your expected output is?

 

Best Regards,
Community Support Team _ Caitlyn

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors