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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
RafaelAri
Helper II
Helper II

Custom column based on existing columns

I want to add a custom column, after loading an Excel file to Power BI, so that I can define a number of IF conditions, which depend on existing columns.
(For example: if "Employee number greater than 50" and "Employee name contains ###" and "Work start date greater than 1/1/2022" .... then ....)

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@RafaelAri , In DAX you can use Switch or if, power query you can use if then else

 

if([employee number] > 50 && containsstring([employee name], "ABC" ) && [Work Start Date] > date(2022,1,1) ,1 ,0 ) 

 

You can try Search or find too

 

SEARCH and FIND: https://www.youtube.com/watch?v=mZt0HJw4gjQ&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=45

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
RafaelAri
Helper II
Helper II

Thanks Steve

amitchandak
Super User
Super User

@RafaelAri , In DAX you can use Switch or if, power query you can use if then else

 

if([employee number] > 50 && containsstring([employee name], "ABC" ) && [Work Start Date] > date(2022,1,1) ,1 ,0 ) 

 

You can try Search or find too

 

SEARCH and FIND: https://www.youtube.com/watch?v=mZt0HJw4gjQ&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=45

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hello @RafaelAri

 

Just to add on to amitchandak's answer, in case you're unclear on how to create a new column.

 

1. Go to the Data view, using the icon on the far left.

2. In the ribbon, under Column tools, click the "New column" button.

3. Enter the DAX formula in the formula bar.

 

Please see the screenshots below:


SteveHailey_0-1662988157909.png

 

-Steve

Helpful resources

Announcements
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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.