Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Good afternoon,
I have a table that looks like the below:
Name Approach date
Client 1 01/01/2025
Client 2 04/01/2025
Client 3 01/02/2025
Client 2 03/02/2025
Client 1 05/02/2025
Client 3 01/03/2025
Client 4 12/03/2025
Client 5 14/03/2025
My manager needs to know the number of clients that are new every month. How would I go about getting a calculated column that shows 'New client' for new clients and 'Not new client' for clients that aren't, or 'True' or 'False, something along those lines? I have tried a few things but it seems to get confused when a new client approaches us more than once within the same month. Please see below what I would like to see:
Name Date New/not new client
Client 1 01/01/2025 New client
Client 2 04/01/2025 New client
Client 3 01/02/2025 New client
Client 2 03/02/2025 Not new client
Client 1 05/02/2025 Not new client
Client 3 01/03/2025 Not new client
Client 4 12/03/2025 New client
Client 5 14/03/2025 New client
Furthermore, this might be more complicated, but I would also like to have two other calculated columns:
- One that shows 'long-term clients', meaning those that have approached us in at least three separate months within the past year (12 months).
- One that shows 'returning' clients, meaning those that have approached us again after no contact for 180 days.
Any help would be greatly appreciated as I've been racking my brain over this one.
Many thanks in advance!
Solved! Go to Solution.
you can try this to create calculated columns
Proud to be a Super User!
Hi,
Write these calculated column formulas
Month number = MONTH(Data[Date])
Status = if(CALCULATE(COUNTROWS(Data),FILTER(Data,Data[Name]=EARLIER(Data[Name])&&Data[Month number]<EARLIER(Data[Month number])))<>BLANK(),"Not new client","New client")
Hope this helps.
you can try this to create calculated columns
Proud to be a Super User!
Hello @MadalenaBicho
Can you try these formulas:
IsNewClientInMonth =
VAR ClientName = [Name]
VAR CurrentDate = [Approach date]
VAR CurrentMonth = EOMONTH(CurrentDate, 0)
VAR FirstContactInMonth =
CALCULATE(
MIN('YourTable'[Approach date]),
FILTER(
'YourTable',
[Name] = ClientName &&
EOMONTH([Approach date], 0) = CurrentMonth
)
)
RETURN
IF(CurrentDate = FirstContactInMonth, "New client", "Not new client")
IsLongTermClient =
VAR ClientName = [Name]
VAR CurrentDate = [Approach date]
VAR StartDate = EDATE(CurrentDate, -12)
VAR MonthsContacted =
CALCULATETABLE(
DISTINCT(
SELECTCOLUMNS(
FILTER(
'YourTable',
[Name] = ClientName &&
[Approach date] >= StartDate &&
[Approach date] <= CurrentDate
),
"Month", FORMAT([Approach date], "YYYY-MM")
)
)
)
VAR MonthCount = COUNTROWS(MonthsContacted)
RETURN IF(MonthCount >= 3, "Long-term client", BLANK())
IsReturningClient =
VAR ClientName = [Name]
VAR CurrentDate = [Approach date]
VAR PreviousDate =
CALCULATE(
MAX('YourTable'[Approach date]),
FILTER(
'YourTable',
[Name] = ClientName &&
[Approach date] < CurrentDate
)
)
VAR Gap = DATEDIFF(PreviousDate, CurrentDate, DAY)
RETURN
IF(NOT(ISBLANK(PreviousDate)) && Gap >= 180, "Returning client", BLANK())
User | Count |
---|---|
97 | |
77 | |
77 | |
48 | |
26 |