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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
Anonymous
Not applicable

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

Anonymous
Not applicable

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.