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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register 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
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.