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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
M_SBS_6
Helper V
Helper V

If Statement

Hi, can someone please help with the correct syntax below please?

 

I am trying to categorise the expected application end date by adding on 2.6 years to applicants from their app_in date. 

 

If app_in 01/01/2024 then 2.6 years will be 01/06/2026.

 

App_end = if(app[age group] = "18-25", date(year(app[app_in])+2.6,

month(app[app_in]), day(app[app_in]))

1 ACCEPTED SOLUTION
Idrissshatila
Super User
Super User

Hello @M_SBS_6 ,

 

you can acheive what you want in the following measure

App_end = if(app[age group] = "18-25", date(year(app[app_in])+2,

month(app[app_in])+5, day(app[app_in])))

 

Idrissshatila_0-1713432050506.png

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




View solution in original post

3 REPLIES 3
AmiraBedh
Super User
Super User

You need a calculated column : 

App_end = 
IF(
    app[age group] = "18-25",
    EDATE(
        app[app_in],
        2 * 12 + 7 // here you add 2 years and 7 months to app_in date
    ),
    app[app_in] // here your default case if age group is not "18-25"
)

Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
PhilipTreacy
Super User
Super User

@M_SBS_6 

 

How much is 0.6 of a year?  Please provide an example of the result of adding 2.6 years to a date.

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Idrissshatila
Super User
Super User

Hello @M_SBS_6 ,

 

you can acheive what you want in the following measure

App_end = if(app[age group] = "18-25", date(year(app[app_in])+2,

month(app[app_in])+5, day(app[app_in])))

 

Idrissshatila_0-1713432050506.png

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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