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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
Im trying to create a new column that returns a value from another table based on condition / filter.
As you see I have the following 2 tables. I want to create a new column in Table 2, in that column I need to return the "Sales Person" of the first Log_ID.
(Note: in my relationship model there is an Inactive relationship by "Acct Nr.")
Solved! Go to Solution.
Hi @hassanh_2
Please try
NewColumn =
MAXX (
TOPN (
1,
CALCULATETABLE ( Table2, USERELATIONSHIP ( Table1[Acct Nr], Table2[Acct Nr] ) ),
Table2[Log_ID], ASC
),
Table2[Sales Person]
)
Is there a way though to create it as a Column so I can use it as a Parameter dimension in other visuals?
What is the direction of the relationship between the two tables? Can you provide a screenshot?
I created the same function as a measure and it worked. Thank you!
Hi @hassanh_2
Please try
NewColumn =
MAXX (
TOPN (
1,
CALCULATETABLE ( Table2, USERELATIONSHIP ( Table1[Acct Nr], Table2[Acct Nr] ) ),
Table2[Log_ID], ASC
),
Table2[Sales Person]
)
Hi, Thanks!
It seems you switched the Table Numbers but I tried both ways and the new column didnt return any value!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 20 | |
| 12 | |
| 11 |