Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have two tables. I want to pull the visit dates from Table 1 into Table 2 but in its own column along the subject # row.
what DAX formula should I use to populated the columns in Yellow?
There is a relationship between Table 2 and Table 1 for the Subject #. Table 2 has all distinct subject #'s listed.
Basically, lookup the subject # in table 2 on table 1 and pull in the visit date when the visit name is "Baseline".
thank you!
Solved! Go to Solution.
@guanel1 , best way is you pivot the table or a copy of it and then merge with table2. Both In power Query
https://radacad.com/pivot-and-unpivot-with-power-bi
https://radacad.com/append-vs-merge-in-power-bi-and-power-query
Videos : pivot: https://www.youtube.com/watch?v=2HjkBtxSM0g
Merge: https://www.youtube.com/watch?v=zNrmbagO0Oo
In Dax you can do like , create 4 columns like given example
baseline = max(filter(Table1, Table1[subject#] = table2[subject#] && table1[Visit name]="Baseline"),[Visit Date])
Procedure = max(filter(Table1, Table1[subject#] = table2[subject#] && table1[Visit name]="Procedure"),[Visit Date])
30 Day = max(filter(Table1, Table1[subject#] = table2[subject#] && table1[Visit name]="30Day"),[Visit Date])
60 Day = max(filter(Table1, Table1[subject#] = table2[subject#] && table1[Visit name]="60Day"),[Visit Date])
put this code in calculated column
=SWITCH(Table2[Visit Name],"Baseline",RELATED(Table1[Baseline]),"Procedure",RELATED(Table1[Procedure])"30 Day",RELATED(Table1[30 Day]),"60 Day",RELATED(Table1[60 Day]))
@guanel1 , best way is you pivot the table or a copy of it and then merge with table2. Both In power Query
https://radacad.com/pivot-and-unpivot-with-power-bi
https://radacad.com/append-vs-merge-in-power-bi-and-power-query
Videos : pivot: https://www.youtube.com/watch?v=2HjkBtxSM0g
Merge: https://www.youtube.com/watch?v=zNrmbagO0Oo
In Dax you can do like , create 4 columns like given example
baseline = max(filter(Table1, Table1[subject#] = table2[subject#] && table1[Visit name]="Baseline"),[Visit Date])
Procedure = max(filter(Table1, Table1[subject#] = table2[subject#] && table1[Visit name]="Procedure"),[Visit Date])
30 Day = max(filter(Table1, Table1[subject#] = table2[subject#] && table1[Visit name]="30Day"),[Visit Date])
60 Day = max(filter(Table1, Table1[subject#] = table2[subject#] && table1[Visit name]="60Day"),[Visit Date])
Thankyou, this worked. And thanks for posting links to articles and videos that show this process. Those really help the newbie understand how to do this!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 17 | |
| 8 | |
| 8 | |
| 7 |