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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

Top Solution Authors