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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
carpe79
Regular 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.