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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Custom Column return value based on two other columns

Hi,

Hoping y'all can help me.

Basically i want to create a custom column that picks up a value from Column 3 based on whether Column 1 and Column 2 contains something. Essentially the custom column will return Column 3 if Column 1 is NULL but at the same time if Column 2 is NOT NULL.  

 

it's pretty straight forward to pick up a value from Column 3 if Column 1 is NULL but i can't seem to do it if Column 2 is NOT NULL(As ignore when it contains NO VALUE/IS BLANK).  See screenprint below:Capture.PNG

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You will have to replace the empty/blank cells in Column2 with null, but then you can use this expression

 

= if [Column1] = null and [Column2] <> null then [Column3] else null

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

You will have to replace the empty/blank cells in Column2 with null, but then you can use this expression

 

= if [Column1] = null and [Column2] <> null then [Column3] else null

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Thank you Pat 🙂 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors