Forum Discussion

Keks's avatar
Keks
Frequent Visitor
2 years ago
Solved

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_Parent ID_Child Paren...
  • Anonymous's avatar
    Anonymous
    2 years ago

    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:

     

    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.