cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DSwezey
Helper II
Helper II

Custom Column Multiple If Statements

I'm not one for nested IF statements but some help would be nice. 

I have a table with 4 columns (A1-4)

I want to create a custom column that takes the value from the right most column if not null

DSwezey_0-1635522582104.png

So I want to do the following:

IF A4 = null THEN A3 ELSE A4

IF A3 = null THEN A2 ELSE A3

IF A2 = null THEN A1 ELSE A2

 

The end result should look like this:

DSwezey_1-1635522883434.png

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @DSwezey ,

 

You can try the following in a new custom column:

 

List.Last(List.RemoveNulls({[A1], [A2], [A3], [A4]}))

 

 

Pete

View solution in original post

3 REPLIES 3
BA_Pete
Super User
Super User

Hi @DSwezey ,

 

You can try the following in a new custom column:

 

List.Last(List.RemoveNulls({[A1], [A2], [A3], [A4]}))

 

 

Pete

View solution in original post

This only pulled values from the [A4] column

Hi,

 

Sorry, I forgot to remove nulls. I've updated my original post 🙂

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Top Solution Authors