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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

add a column with the value from another column by index

Hello guys!

I have a task that seems simple, but have no idea how to solve this. I have a table with names of services (field "name"), some services are subservices of services inside that same table. I want to add column to that table with the name of parent service by it's "parent id". Could you please tell how i can do it?

 

Thanks!

 

VShved_0-1651134421152.png

VShved_1-1651135645080.png

 

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download sample PBIX file

 

This DAX will create your column

 

 

Parent Name = CALCULATE(MAXX('Servises','Servises'[name]), FILTER('Servises', 'Servises'[id] = EARLIER('Servises'[parent_id])))

 

 

 

parent_name.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

2 REPLIES 2
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download sample PBIX file

 

This DAX will create your column

 

 

Parent Name = CALCULATE(MAXX('Servises','Servises'[name]), FILTER('Servises', 'Servises'[id] = EARLIER('Servises'[parent_id])))

 

 

 

parent_name.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Thanks a lot, it did create needed column!

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.