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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
ROCKYDO12
Helper III
Helper III

Customer Status

Hello,

 

I am getting stuck with implementing this column for creating New, Renewed (Purchased PFY and CFY) and Reactived Custumers (Purchased CFY and any other FY other than PFY). For some reason Power BI isn't taking my Customer ID field and it's not working in my calculation. I was hoping someone can look at my demo file attached.

 

Here is a link to a cleased report with data needed to preform this fuction.  https://drive.google.com/file/d/1xVglVcsvDiHK3t_54cJ9geOrtpw8KdVr/view?usp=sharing

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

I assumed that fiscal year starts from january 1st.

 

Picture1.png

 

 

New customers count: = 
VAR _currentyear =
    MAX ( 'Calendar'[Year CC] )
VAR _currentcustomerlist =
    CALCULATETABLE ( VALUES ( 'Customer'[System Record ID] ), 'Customer Base' )
VAR _previouscustomerlist =
    CALCULATETABLE (
        VALUES ( 'Customer'[System Record ID] ),
        FILTER ( 'Customer Base', RELATED ( 'Calendar'[Year CC] ) < _currentyear )
    )
VAR _newcustomerlist =
    EXCEPT ( _currentcustomerlist, _previouscustomerlist )
RETURN
    IF ( HASONEVALUE ( 'Calendar'[Year CC] ), COUNTROWS ( _newcustomerlist ) )

 

 

 

Renew customers count: = 
VAR _currentyear =
    MAX ( 'Calendar'[Year CC] )
VAR _currentcustomerlist =
    CALCULATETABLE ( VALUES ( 'Customer'[System Record ID] ), 'Customer Base' )
VAR _previouscustomerlist =
    CALCULATETABLE (
        VALUES ( 'Customer Base'[System Record ID] ),
        FILTER ( 'Customer Base', RELATED ( 'Calendar'[Year CC] ) = _currentyear - 1 )
    )
VAR _customerlist =
    INTERSECT ( _currentcustomerlist, _previouscustomerlist )
RETURN
    IF ( HASONEVALUE ( 'Calendar'[Year CC] ), COUNTROWS ( _customerlist ) )

 

 

 

reactivate customers count: = 
VAR _currentyear =
    MAX ( 'Calendar'[Year CC] )
VAR _currentcustomerlist =
    CALCULATETABLE ( VALUES ( 'Customer Base'[System Record ID] ), 'Customer Base' )
VAR _previouscustomerlist =
    CALCULATETABLE (
        VALUES ( 'Customer Base'[System Record ID] ),
        FILTER ( 'Customer Base', RELATED ( 'Calendar'[Year CC] ) < _currentyear - 1 )
    )
VAR _customerlist =
    INTERSECT ( _currentcustomerlist, _previouscustomerlist )
RETURN
    IF ( HASONEVALUE ( 'Calendar'[Year CC] ), COUNTROWS ( _customerlist ) )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

6 REPLIES 6
ROCKYDO12
Helper III
Helper III

Please disregard! Thank you very much for your help and efforts. I was using the wrong field!!!!!! Wow this would of saved me a bunch of time if only I knew.

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

I assumed that fiscal year starts from january 1st.

 

Picture1.png

 

 

New customers count: = 
VAR _currentyear =
    MAX ( 'Calendar'[Year CC] )
VAR _currentcustomerlist =
    CALCULATETABLE ( VALUES ( 'Customer'[System Record ID] ), 'Customer Base' )
VAR _previouscustomerlist =
    CALCULATETABLE (
        VALUES ( 'Customer'[System Record ID] ),
        FILTER ( 'Customer Base', RELATED ( 'Calendar'[Year CC] ) < _currentyear )
    )
VAR _newcustomerlist =
    EXCEPT ( _currentcustomerlist, _previouscustomerlist )
RETURN
    IF ( HASONEVALUE ( 'Calendar'[Year CC] ), COUNTROWS ( _newcustomerlist ) )

 

 

 

Renew customers count: = 
VAR _currentyear =
    MAX ( 'Calendar'[Year CC] )
VAR _currentcustomerlist =
    CALCULATETABLE ( VALUES ( 'Customer'[System Record ID] ), 'Customer Base' )
VAR _previouscustomerlist =
    CALCULATETABLE (
        VALUES ( 'Customer Base'[System Record ID] ),
        FILTER ( 'Customer Base', RELATED ( 'Calendar'[Year CC] ) = _currentyear - 1 )
    )
VAR _customerlist =
    INTERSECT ( _currentcustomerlist, _previouscustomerlist )
RETURN
    IF ( HASONEVALUE ( 'Calendar'[Year CC] ), COUNTROWS ( _customerlist ) )

 

 

 

reactivate customers count: = 
VAR _currentyear =
    MAX ( 'Calendar'[Year CC] )
VAR _currentcustomerlist =
    CALCULATETABLE ( VALUES ( 'Customer Base'[System Record ID] ), 'Customer Base' )
VAR _previouscustomerlist =
    CALCULATETABLE (
        VALUES ( 'Customer Base'[System Record ID] ),
        FILTER ( 'Customer Base', RELATED ( 'Calendar'[Year CC] ) < _currentyear - 1 )
    )
VAR _customerlist =
    INTERSECT ( _currentcustomerlist, _previouscustomerlist )
RETURN
    IF ( HASONEVALUE ( 'Calendar'[Year CC] ), COUNTROWS ( _customerlist ) )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Hey,

 

thank you for this. I was hoping to make it work to have a column added with the different statuses instead of apply just a count calculation. Also fiscal year starts April 1, sorry should of clarified.

HotChilli
Community Champion
Community Champion

Questions: I see a field "System Record ID", is that the Customer ID?

and what is the desired output? (So far, I don't see any records with different dates for the same System Record ID and I don't see any logic to do with Financial Year)

Output result would look like this.

 

ROCKYDO12_0-1657637261896.png

 

Hey,

 

Yes, System Record ID is Customer ID. Fiscal Year starts April 1st so I was just planning on adding "03,31" in the calculation. The desired output is to have a column in my data set that would have a customer status applied to it. So either New, Renewed, or re-activated. Then I can pull this field into charts and tables and bring in Count of Customers (System Record ID).

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors