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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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!

 

Anonymous
Not applicable

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.