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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
zbishhh2
Frequent Visitor

Get value from another table based on 2 conditions

Hello I am new to PowerBI and don't even know where to begin with this formula.

I have 2 tables, one is called "cr791_hourlytracking", the other is a list of invoice numbers with account and week start date as columns like so called "Table1". I created a relationship between the two tables for the account and week start date columns.

zbishhh2_0-1636566394028.png

I want to create a new column in the "cr791_hourlytracking" table that pulls invoice numbers based on account and week start date. I have an account and week of column in both tables. 

Table names in "cr791_hourlytracking" are 

"Week Start Date"

"Account"

So I need something like 

If cr791_hourlytracking[weekstartdate] = table[week of] 

and cr791_hourlytracking[account] = table1[account]

then return table1[invoicenumber]

1 ACCEPTED SOLUTION
zbishhh2
Frequent Visitor

I tried this and it didn't work. Returned blanks. Not sure why
LOOKUPVALUE(Table1[Invoice Number],Table1[Week of],cr791_hourlytracking[Week Start Date],Table1[cr791_Account],cr791_hourlytracking[Account])

View solution in original post

3 REPLIES 3
zbishhh2
Frequent Visitor

I tried this and it didn't work. Returned blanks. Not sure why
LOOKUPVALUE(Table1[Invoice Number],Table1[Week of],cr791_hourlytracking[Week Start Date],Table1[cr791_Account],cr791_hourlytracking[Account])

That seems like it should work unless there are multiple Invoice Number values for a given week and account.

 

Can you verify that both week columns are date type and the dates do align like you expect?

Yeah that fixed it. I guess when I made the list of invoice numbers and dates I messed up. I cleaned it up and the formula worked.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.