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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Keks
Frequent Visitor

Create new column while comparing 2 other

Hi everybody, 
I would like to create a view and/or export for having the abilty to know the exact composition of my articles on the 3 levels of their composition.

ID_ParentID_ChildParent_article_NameArticle_Name
15Lev2_xxxLev3_yyy
26Lev2_zzzLev3_aaa
31Lev1_bbbLev2_xxx
42Lev1_xxxLev2_zzz
27Lev2_zzzLev3_bbb
28Lev2_zzzLev3_ccc
18Lev2_xxxLev3_ccc

 

 

And I would like to be able to do this

Level1Level 2Level 3
Lev1_bbb  
 Lev2_xxx 
  Lev3_yyy
  Lev3_ccc
Lev1_xxx  
 Lev2_zzz 
  Lev3_aaa
  Lev3_bbb
  Lev3_ccc

 

So,
- for level 1 : ID_Parent never exists in ID_Child
- for level 2 : ID_Child may exists in ID_Parent

- for level 3 : ID_Child never exists in ID_Parent

How can I do that ? Do I need 3 columns ? 
1. Article Name Level 1
2. Article Name Level 2 
3. Article Name Level 3 ? 

Can someone please help me?
Thanks in advance for your help

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Keks 

You can create columns and try the following DAX

Level 1 = 
IF(
    NOT('Table'[ID_Parent] IN VALUES('Table'[ID_Child])),
    'Table'[Parent_article_Name],
    BLANK()
)
Level 2 = 
IF(
    ('Table'[ID_Child] IN VALUES('Table'[ID_Parent])),
    'Table'[Article_Name],
    BLANK()
)
Level 3 = 
IF(
    NOT('Table'[ID_Child] IN VALUES('Table'[ID_Parent])),
    'Table'[Article_Name],
    BLANK()
)

Here is my preview:

vyohuamsft_0-1714545151828.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

1 REPLY 1
Anonymous
Not applicable

Hi, @Keks 

You can create columns and try the following DAX

Level 1 = 
IF(
    NOT('Table'[ID_Parent] IN VALUES('Table'[ID_Child])),
    'Table'[Parent_article_Name],
    BLANK()
)
Level 2 = 
IF(
    ('Table'[ID_Child] IN VALUES('Table'[ID_Parent])),
    'Table'[Article_Name],
    BLANK()
)
Level 3 = 
IF(
    NOT('Table'[ID_Child] IN VALUES('Table'[ID_Parent])),
    'Table'[Article_Name],
    BLANK()
)

Here is my preview:

vyohuamsft_0-1714545151828.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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