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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
faronicus
Frequent Visitor

How to grab a value from one column row based on a condition of another column row

Hello,

 

Relatively new to Power BI. I am just using one table here. I just want to retrieve the value (simply get the value, no calculation) of one column, based on a condition of another column, and place that value into a new, third column.

So for example:

Animal             Type                New Column

Beaver              Mammal         

Lizard               Reptile

Monkey            Mammal

Snake                Reptile

 

If the Type = Mammal then I'd like the Animal value placed in New Column. How is this done??

Result should be this:

Animal              Type                New Column

Beaver               Mammal         Beaver

Lizard                 Reptile

Monkey             Mammal          Monkey

Snake                 Reptile

 

Bonus points for putting a value in the blanks, like "null" or "NA". Thanks.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@faronicus 
I am glad to help you.
You could try this:

 

New Column = IF('Table'[Type] = "Mammal", 'Table'[Animal], BLANK())
New Column2 = IF('Table'[Type] = "Mammal", 'Table'[Animal], "NA")

 

 the test result :

vjtianmsft_0-1719364375244.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
faronicus
Frequent Visitor

Thank you, that's what I wanted!

Anonymous
Not applicable

Hi,@faronicus 
I am glad to help you.
You could try this:

 

New Column = IF('Table'[Type] = "Mammal", 'Table'[Animal], BLANK())
New Column2 = IF('Table'[Type] = "Mammal", 'Table'[Animal], "NA")

 

 the test result :

vjtianmsft_0-1719364375244.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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