Forum Discussion
Anonymous
7 years agoNot applicable
Measure - Parent child relationship
Hi,
I need to create a measure to Parent name using id=parentid join.
Table
| id | Name | Parent_id |
| 101 | A | |
| 102 | B | 101 |
| 103 | C | 101 |
| 104 | D | 103 |
| 105 | E | 103 |
Create a Measure "Parent Name".
| id | Name | Parent Name |
| 101 | A | |
| 102 | B | A |
| 103 | C | A |
| 104 | D | C |
| 105 | E | C |
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
- jdbuchanan71
Super User
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
Community Champion
Strange. I tried your solution, why mine is showing n/a?
- jdbuchanan71
Super User
In your table, is ID a number and Parent ID text?