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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
powerbidu
Frequent Visitor

Create 'IF' function across 2 tables

Hi all, I have the below dataset:

Table 1   
IdentifierDeadline  
A5  
B6  
C7  
D8  
E9  
    
    
Table 2   
IdentifierMonth EndDays takenIs 'Days taken' more than deadline?
A28-Feb6Yes
A31-Mar3No
A30-Apr5No
A31-May7Yes
B31-May8Yes

 

I am trying to create the calculated column "Is 'Days taken' more than deadline?" in Table 2.

I used the below function:

Is 'Days taken' more than deadline? = IF('Table 2'[Days taken] > 'Table 1'[Deadline], "Yes", "No")

 

However, I got the below error message:

A single value for column 'Deadline' in table 'Table 1' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

Can anyone advise why the error is flagging and what formula I could write to get the expected result?

 

Thanks in advance.

1 ACCEPTED SOLUTION
vivek31
Resolver II
Resolver II

HI @powerbidu,

 

you can use lookupvalue function and create a column 

Day taken more = 
var identifier = LOOKUPVALUE(Table__1[Deadline],Table__1[Identifier],Table__2[Identifier]) 
RETURN
IF(Table__2[Days taken] > identifier ,"YES","NO")

vivek31_0-1743434847360.png

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
vivek31
Resolver II
Resolver II

HI @powerbidu,

 

you can use lookupvalue function and create a column 

Day taken more = 
var identifier = LOOKUPVALUE(Table__1[Deadline],Table__1[Identifier],Table__2[Identifier]) 
RETURN
IF(Table__2[Days taken] > identifier ,"YES","NO")

vivek31_0-1743434847360.png

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

johnt75
Super User
Super User

Create a relationship from Table 1 to Table 2 based on the identifier column. Then you can use

Is 'Days taken' more than deadline? =
IF ( 'Table 2'[Days taken] > RELATED ( 'Table 1'[Deadline] ), "Yes", "No" )

Hi, I got the error 'The column 'XXX[XXX]' either doesn't exist or doesn't have a relationship to any table available in the current context." I checked and had set up the relationship and referenced the column correctly. Any idea on what could be wrong? Thank you.

Make sure you're creating a new column, not a measure. You wouldn't be the first to make that mistake.

Yes it is already a column and not a measure, but the error pops up.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.