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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
David_
New Member

Referencing a column based on values in another column

Hi, I'm trying to tell which column I want to look in table b based on values in a column in table a. The column in table A have 1, 2, 3, 4 in them and table B have columns named 1, 2, 3, 4

In excel id use something like index/match but i can't wrap my head around what to do in DAX.
Below you can see what I'm kinda trying to do.

Column =
var _var1 = 'Table_A'[Column_1]
var _var2 = "'Table_B'[" & _var1 & "]"
return
RELATED(_var2)

Hope someone has some good input. Thanks in advance!
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

@David_ 

It dies not work this way with DAX. you need first to unpivot your table using power quert then you column names will become values in the Attributes column. Then filtering will be simple

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

@David_ 

It dies not work this way with DAX. you need first to unpivot your table using power quert then you column names will become values in the Attributes column. Then filtering will be simple

Found how to do it, thank you for the help.

Thank you. 
I'm not really sure how this works?

Could you explain a bit?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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