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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

If date field is this year

Hi all,

 

We have a company table containing a date field called "Onboarding Date".

 

I want to make a calculated column based on that date to be like this:

 

If Onboarding Date is blank OR in current year; "New"; "Existing".

 

However, I am not sure how to make this.

 

Thanks for the help 🙂

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

try column

Column = 
IF( 
OR(ISBLANK([Onboarding Date]), YEAR([Onboarding Date]) = YEAR(TODAY()) ),
"New",
"Existing"
)

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

4 REPLIES 4
bakerm00
Regular Visitor

since i've gone thru the pain of learning this today. 

determines if an end date is in this year or next (for a gantt visual filter)

= Table.AddColumn(#"convert progress to percent", "ganttyearfilter", each if([Forecast End Date] is null) then "0" else if(Date.IsInCurrentYear([Forecast End Date])) then "1" else if(Date.IsInNextYear([Forecast End Date]))then "2" else "99")

amitchandak
Super User
Super User

create a new column

 

New Vs Exiting = 
IF( (ISBLANK([Onboarding Date]) || YEAR([Onboarding Date]) = YEAR(TODAY()) ),"New","Existing"
)

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
SivaMani
Resident Rockstar
Resident Rockstar

@Anonymous,

 

Here you go,

Onboarding Type = IF(OR(ISBLANK('Table'[Onboarding Date]),YEAR( 'Table'[Onboarding Date] = YEAR(TODAY()))),"New", "Existing")
 
Let me if any issue or need any help!
 
Regards,
Siva Mani
az38
Community Champion
Community Champion

Hi @Anonymous 

try column

Column = 
IF( 
OR(ISBLANK([Onboarding Date]), YEAR([Onboarding Date]) = YEAR(TODAY()) ),
"New",
"Existing"
)

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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