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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.