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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Roy_tap
Helper I
Helper I

Creating a new column using either custom or conditional column value

Hi,

 

I have an existing import table containing of date values as such:

ProcessStep NameLast UpdateStep aStep bStep cStep d
P1Step a01-01-0101-01-01   
P2Step b07-07-0103-03-0107-07-01  
P3Step a02-02-0102-02-01   
P4Step d06-06-0104-04-01  06-06-01
P5Step c05-05-0103-03-01 05-05-01 

 

How can I create a new column to replace the Last Update column in the Query Studio to meet the following condition:
When Step Name = Step b, Last Update will be replace with Step a value

When Step Name = Step d, Last Update will be replace with Step a value

Else = Last Update value

Final table should looks like this: (Highlighted value is the updated value)

ProcessStep NameLast UpdateStep aStep bStep cStep dLast Update1
P1Step a01-01-0101-01-01   01-01-01
P2Step b07-07-0103-03-0107-07-01  03-03-01
P3Step a02-02-0102-02-01   02-02-01
P4Step d06-06-0104-04-01  06-06-0104-04-01
P5Step c05-05-0103-03-01 05-05-01 05-05-01

 

Thanks.

1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @Roy_tap 

 

add a custom column

Vera_33_0-1631772866191.png

 

if [Step Name]="Step b" or [Step Name]="Step d" then [Step a] else [Last Update]

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

In the formula bar, type:

 

= Table.AddColumn(NameOfPriorStep, "Last Update 1", each if [Step Name] = "Step b" then [Step a] else if [Step Name] = "Step d" then [Step a] else [Last Update])

 

--Nate

Vera_33
Resident Rockstar
Resident Rockstar

Hi @Roy_tap 

 

add a custom column

Vera_33_0-1631772866191.png

 

if [Step Name]="Step b" or [Step Name]="Step d" then [Step a] else [Last Update]

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 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.