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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Custom Column with IF and else

i wanted to  create a simple formula either measure or Column

Filter Scope
IF assignment date = 2022/09/19 = Then "Existing emp Initial launch"
If assignment date > date 2022,9,19 = " Role change "
Else assignment date <= hire date = "New Hire"

 

i had some help from Data engineers who helped me with this using switch but that too advance to understand and i want to learn its simple way can you please help 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

You can add a new column with below code

New Column = 
IF (
    'DataTable'[assignment date] = DATE ( 2022, 9, 19 ),
    "Existing emp Initial launch",
    IF (
        'DataTable'[assignment date] > DATE ( 2022, 9, 19 ),
        "Role change",
        IF ( 'DataTable'[assignment date] <= 'DataTable'[hire date], "New Hire" )
    )
)

vjingzhang_0-1673251819649.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!

 

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

You can add a new column with below code

New Column = 
IF (
    'DataTable'[assignment date] = DATE ( 2022, 9, 19 ),
    "Existing emp Initial launch",
    IF (
        'DataTable'[assignment date] > DATE ( 2022, 9, 19 ),
        "Role change",
        IF ( 'DataTable'[assignment date] <= 'DataTable'[hire date], "New Hire" )
    )
)

vjingzhang_0-1673251819649.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!

 

Surya9
Resolver III
Resolver III

Scope = IF(assignment date = 2022/09/19 , "Existing emp Initial launch",
                  IF(assignment date > 2022/09/19, "Role change",
                      IF(assignment date <= hire date, "New Hire")))

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.