Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Measure - Parent child relationship

Hi,

 

I need to create a measure to Parent name using id=parentid join.

 

Table

idNameParent_id
101A 
102B101
103C101
104D103
105E103

 

 

Create a Measure "Parent Name".

 

idNameParent Name
101A 
102BA
103CA
104DC
105EC

 

Can't modify the Dataset due to company policy.

 

Is there a way to calculate the measure?

 

 

  • Ahh, I had done mine as a measure.  Because you said you couldn't modify the data set I thought you couldn't add a column.  I have updated the calculated column to work and also added in the measure in the attached file.

     

6 Replies

  • Hello Anonymous 

    Give this a try.

    Parent Name =
    VAR RowParent =
        SELECTEDVALUE ( 'Your Table'[Parent_id] )
    RETURN
        IF (
            ISBLANK ( RowParent ),
            "n/a",
            LOOKUPVALUE ( 'Your Table'[Name], 'Your Table'[id], RowParent )
        )
    

     

    • mussaenda's avatar
      mussaenda
      Icon for Community Champion rankCommunity Champion

      Strange. I tried your solution, why mine is showing n/a?