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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
HarpalsinhZala
New Member

Need to create column based on conditions on values of two separate column

Hi Folks,

I need your help, I am new to this platform.

I have data source of sharepoint list.

Here i give you a short explaination about my database.

I have table that contains columns channel,asset type,asset number. I want to create column based on perticular channel and perticular asset type.  Please have a look at below table.

ChannelAsset TypeAsset Number
testa15
zeeb25
leec19
leea

10

alemalem

58

leea

45

alemalem

85

testb

05

 

1) now i want to create a new column: Column A that contains number of asset only for asset type a or b. for which i use following 

logic in custom column:

if [asset type] = a or [asset type]=b then [asset number] else null.

 

2) I want to create another column that contains asset number only for which have channel and asset type both as "alem".

 i used following logic

  if [channel] = "alem" then if [asset type] = "alem" then [asset number] else 0 else null.

 

Please help to resolve it. 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @HarpalsinhZala,

You can try to create a calculated column with the below formula if it meets your requirement:

Replaced =
IF (
    table[channel] = "alem",
    IF ( table[asset type] = "alem", table[asset number], 0 )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @HarpalsinhZala,

You can try to create a calculated column with the below formula if it meets your requirement:

Replaced =
IF (
    table[channel] = "alem",
    IF ( table[asset type] = "alem", table[asset number], 0 )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Fowmy
Super User
Super User

@HarpalsinhZala 

Can you try this : 
(This is in Power Query)

if [channel] = "alem" and [asset type] = "alem" then [asset number] else 0

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi @Fowmy 

Thanks for solution, but sorry it's not working.

please help me with another alternative.

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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