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 am brand new to Power BI and having a few issues to look up values between 2 columns in another table.
So, I have two tables (placed below) and I am trying to take value from TABLE1 in the column "In Serial" and according the column "Data" (date) go to TABLE2 match the date and then look up the value between two columns "Value in" and "Value out" when it found, the desired result is to add a new column in TABLE1 with the information as "text" from Column "ProgramN" in TABLE2.
TABLE1
TABLE2
The result would be something like this:
TABLE1
Thank you very much in advance for any help!! Please let me know if you would like any additional information 🙂
Solved! Go to Solution.
try this code as calculated column in Table1, you may need to adjust table and column names
ProgramN =
VAR __Date = 'Table1'[Data]
VAR __InSerial = 'Table1'[IN SERIAL]
VAR __RelevantRowsTable2 =
FILTER (
'Table2',
'Table2'[Date] = __Date
&& 'Table2'[Value in] <= __InSerial
&& 'Table2'[Value out] >= __InSerial
)
RETURN
CALCULATE ( FIRSTNONBLANK ( 'Table2'[ProgramN], TRUE ), __RelevantRowsTable2 )
Proud to be a Datanaut!
Thank you Stachu. I tried this solution. I spent 2 weeks for this.
try this code as calculated column in Table1, you may need to adjust table and column names
ProgramN =
VAR __Date = 'Table1'[Data]
VAR __InSerial = 'Table1'[IN SERIAL]
VAR __RelevantRowsTable2 =
FILTER (
'Table2',
'Table2'[Date] = __Date
&& 'Table2'[Value in] <= __InSerial
&& 'Table2'[Value out] >= __InSerial
)
RETURN
CALCULATE ( FIRSTNONBLANK ( 'Table2'[ProgramN], TRUE ), __RelevantRowsTable2 )
Proud to be a Datanaut!
Stachu thank you very much, I spent much time trying to resolve this, now it worked, so happy, thx!! 🙂
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 | |
| 6 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 14 | |
| 8 | |
| 8 | |
| 8 |