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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
carpe79
Frequent Visitor

Lookupvalue From Column name

Hi There ;

 

I need your support to create a column , let me explain what i need ;

 

I have two table , "Table A " and "Table B" named , 

 

Table A is as below ,  it has date column and number column , under number column there are numbers as you see

 

 cap1.JPG

 

And Table B is as below , it has date column too , but there are columns after that which are named with numbers , and under this number named columns there are values.

 

cap2.JPG

 I need that , system will make lookupvalue and will take value from Table B to Table A like that  ; system will check on Table A date column , and will check on Table B date colum too if there is same date , then system will check on Table A number named column , and then will take this number and will check Table B column names , which one is this number , and after that will put under this number value to Table A 

 

an example will be more easy to understand maybe 🙂 ..... on Table A first line , date is   "1.11.2013" and near it under "number " column value is " 3" , now we will check on Table B date coulmn, when , we can see in this dataset first line date is "1.11.2023" too , then for second reference  our value from Table A was "3" , now for the same line we will check column names and find "3" , Where column "3"  meets the date column value is "125" , so this value will come to Table A as a new column as below excample like a calculated column.

 

cap3.JPG

 

 

Thanks for your kind supports 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@carpe79 

you can select the date column in table B and unpivot other columns

11.PNG

12.PNG

 

then you can merge table in PQ

 

press ctrl when select columns, you can see numbers besides the column name. That means the date and number column both need to be matched.

 

13.PNG

 

then you expand the column

 

14.PNG

 

or you can use DAX to create a column

 

Column = LOOKUPVALUE('Table B'[Value],'Table B'[Attribute],'Table A'[Number],'Table B'[Date],'Table A'[Date])
11.PNG
 
pls see the attachment below

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@carpe79 

you can select the date column in table B and unpivot other columns

11.PNG

12.PNG

 

then you can merge table in PQ

 

press ctrl when select columns, you can see numbers besides the column name. That means the date and number column both need to be matched.

 

13.PNG

 

then you expand the column

 

14.PNG

 

or you can use DAX to create a column

 

Column = LOOKUPVALUE('Table B'[Value],'Table B'[Attribute],'Table A'[Number],'Table B'[Date],'Table A'[Date])
11.PNG
 
pls see the attachment below

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.