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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
DSwezey
Helper III
Helper III

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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




This only pulled values from the [A4] column

Hi,

 

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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors