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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors