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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
mmh
Helper I
Helper I

New Customer column

Hi, 

I have a table with repeated and new customers, some new customers  having as initialized date as (1800-1-1 til 1-1-3000)  

Customer_idvalid_fromValid_to
11-1-20201-2-2021
12-1-20213-1-2022  
21-1-1800 1-1-3000    
21-1-20231-2-2024

 

I  would like to have a calculated column or custom column  for new customer as follows:

 

Customer_idvalidFromValidtoNew Customer ?
11-1-20201-2-2021Yes
12-1-20213-1-2022  NO
21-1-1800 1-1-3000    Yes 
21-1-20231-2-2024Yes
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mmh 

You can try the following code:

New Customer = var _filter=FILTER('Table',[Customer_id]=EARLIER('Table'[Customer_id]))
var _indate=MINX(_filter,[valid_from])
var _end=MAXX(FILTER(_filter,[valid_from]=_indate),[Valid_to])
return IF([valid_from]>=_indate&&[Valid_to]<=_end,"Yes","No")

Output

vxinruzhumsft_0-1674035268037.png

Best Regards!

Yolo Zhu

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

7 REPLIES 7
Anonymous
Not applicable

Hi @mmh 

You can refer to the following example:

New Customer = IF(MONTH('Table'[valid_from])=1&&DAY([valid_from])=1,"Yes","No")

vxinruzhumsft_0-1674019834857.png

Best Regards!

Yolo Zhu

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

HI Yolo,

Thanks! But its not correct.  Actually here some new customer having two records as like
Intials date n approved date , so it would be identified as new customer  in both records

Customer_idvalid_fromValid_toNew Customer
2021-1-1800 1-1-3000    Yes
2021-1-20231-2-2024Yes

 

Otherside some customer having record as like

Customer_idvalidFromValidtoNew Customer ?
1011-1-20201-2-2021Yes
1012-1-20213-1-2022  NO 

 

Thank You!

Anonymous
Not applicable

Hi @mmh 

You can try the following code:

New Customer = var _filter=FILTER('Table',[Customer_id]=EARLIER('Table'[Customer_id]))
var _indate=MINX(_filter,[valid_from])
var _end=MAXX(FILTER(_filter,[valid_from]=_indate),[Valid_to])
return IF([valid_from]>=_indate&&[Valid_to]<=_end,"Yes","No")

Output

vxinruzhumsft_0-1674035268037.png

Best Regards!

Yolo Zhu

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

HI Yolo,

Thanks! But its not correct.  Actually here some new customer having two records as like
Intials date n approved date , so it would be identified as new customer  in both records

Customer_idvalid_fromValid_toNew Customer
2021-1-1800 1-1-3000    Yes
2021-1-20231-2-2024Yes

 

Otherside some customer having record as like

Customer_idvalidFromValidtoNew Customer ?
1011-1-20201-2-2021Yes
1012-1-20213-1-2022  NO 

 

FreemanZ
Super User
Super User

hi @mmh 

can you explain your YES/NO logic?

HI Yolo,

Thanks! But its not correct.  Actually here some new customer having two records as like
Intials date n approved date , so it would be identified as new customer  in both records

Customer_idvalid_from Valid_toNew Customer
2021-1-1800  1-1-3000    Yes  (its intial date)
2021-1-20231-2-2024Yes  (its approval date)

 

Otherside some customer having record as like

Customer_idvalidFrom ValidtoNew Customer ?
1011-1-2020 1-2-2021Yes
1012-1-2021 3-1-2022  NO 

 

amitchandak
Super User
Super User

@mmh ,

new column =

var _min = minx(filter(Table, [Customer_id] = earlier([Customer_id])  && [validFrom] < earlier([validFrom]) ), [validFrom])

return

if(_min  = date(1800,01,01) || isblank(_min), "Yes", "No")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.