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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Getting values from a column associated with a value on the same row in PowerBi

What I am trying to do is to get a value on the same row from one column that is associated with a value on another column on the same table.

Currently I have 4 columns. As shown below, I'll call this table the "Objects" table:

 

file idstring idstring
60200Current set
6010080%
30200Current set
3050John D.
10080VIEW
25200

Current set

 

I am currently trying to find a way where PowerBI looks for the "string id", then find the "file id" associated with the value id.

Finally a new column or table will return all values in the "string" column associated with the file id that it found.

 

For example, it looks up the "string ID" 200 then finds the "file ID" 60, 30, 25. Once it gets those ID's it will return the values in the "string" column that are associated with the file ID. So in this example it will return everything except the cell that has "VIEW".

 

I've tried writing an If statement inside of an if statement but that did not work.

 

 

 

 

custom_column = IF(Objects[file id] = (IF(Objects[string id]=200, Objects[file id])), Objects[string])

 

 

 

 

This only returned the value "Current set"

Is there another DAX function I can use to populate a column with the information i need or populate it in a different table?

 

My expected outcome would be as follows

 

if its a different table:

file idstring
60Current set
6080%
30Current set
30John D
25Current set

 

or a custom column next to the original table:

custom_column
Current set
80%

Current set

John D.
 
Current set

 

Thank you in advance.

4 REPLIES 4
lbendlin
Super User
Super User

Show your expected outcome. It is not clear from your description.

Anonymous
Not applicable

Again sorry that I was not clear and cause a bit of confusion. I tried replying to your post but I constantly received an error that said invalid html. So i edited my original post to reflect what I expected.

lbendlin
Super User
Super User

You need to get out of the current filter context for that.

 

custom_column = 
var s = Objects[string id]
var f = SUMMARIZE(filter(Objects,Objects[string id]=s),Objects[file id])
return CALCULATE(CONCATENATEX(Objects,Objects[string],","),All(Objects),Objects[file id] in f)

 

 

By the way your statement "So in this example it will return everything except the cell that has "VIEW"." is not entirely correct.

 

 

lbendlin_1-1613615981660.png

 

 

 

Anonymous
Not applicable

Thank you so much for this. I was hoping to get each value that was associated to the same file id as current set on a seperate row. I would probably need to create a new table and do this? Sorry if i wasnt clear.

 

Unless this would also take a cell thats blank and then I would be able to break down the column by using a comma delimiter to get everything on cell seperated out to their own cells

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.