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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
sy898661
Helper V
Helper V

If conditions in 1 column are met, paste value from another column

Lot Disposition Duration 2 = 
    IF('board-Query'[Lot Current Status] = "Approved for Processing", 'board-Query'[Lot Disposition Duration],
    IF('board-Query'[Lot Current Status] = "Approved", 'board-Query'[Lot Disposition Duration],
    IF('board-Query'[Lot Current Status] = "Quarantine", 'board-Query'[Lot Disposition Duration],
    IF('board-Query'[Lot Current Status] = "Reject", 'board-Query'[Lot Disposition Duration],
    IF('board-Query'[Lot Current Status] = "Conditional Release", 'board-Query'[Lot Disposition Duration],
    ""
    )))))

Hi again everyone!

I was wondering if someone could tell me why I can't do this/how to correctly write this. the error message says "Expressions that yield variant data-type cannot be used to define calculated columns."

 

But I feel like I have done something like this before, I just dont know how! The Lot Current Status column has 10 different statuses, but I only want to look at the ones listed above--and if that condition is met, paste the related value from another column (Lot Distribution Duration)

 

Thanks!!!

2 ACCEPTED SOLUTIONS

try this, with IN clause, it makes your code a lot cleaner  and shorter

Lot Disposition Duration 2 =
IF (
'board-Query'[Lot Current Status]
IN {
"Approved for Processing",
"Approved",
"Quarantine",
"Reject",
"Conditional Release"
},
'board-Query'[Lot Disposition Duration],
""
)

View solution in original post

@sy898661 ,

 

You can also modify your measure like below:

Lot Disposition Duration 2 =
IF (
    'board-Query'[Lot Current Status] = "Approved for Processing"
        || 'board-Query'[Lot Current Status] = "Approved"
        || 'board-Query'[Lot Current Status] = "Quarantine"
        || 'board-Query'[Lot Current Status] = "Reject"
        || 'board-Query'[Lot Current Status] = "Conditional Release",
    'board-Query'[Lot Disposition Duration]
)

Community Support Team _ Jimmy Tao

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

View solution in original post

3 REPLIES 3
sy898661
Helper V
Helper V

I tried this but now its just returning true/false, which i guess is one step closer/better than an error! but still not what i want

Lot Disposition Duration 2 = 
    IF('board-Query'[Lot Current Status] = "Approved for Processing", 'board-Query'[Lot Disposition Duration]
    ||
    IF('board-Query'[Lot Current Status] = "Approved", 'board-Query'[Lot Disposition Duration]
    ||
    IF('board-Query'[Lot Current Status] = "Quarantine", 'board-Query'[Lot Disposition Duration]
    ||
    IF('board-Query'[Lot Current Status] = "Reject", 'board-Query'[Lot Disposition Duration]
    ||
    IF('board-Query'[Lot Current Status] = "Conditional Release", 'board-Query'[Lot Disposition Duration],
    ""
    )))))

@sy898661 ,

 

You can also modify your measure like below:

Lot Disposition Duration 2 =
IF (
    'board-Query'[Lot Current Status] = "Approved for Processing"
        || 'board-Query'[Lot Current Status] = "Approved"
        || 'board-Query'[Lot Current Status] = "Quarantine"
        || 'board-Query'[Lot Current Status] = "Reject"
        || 'board-Query'[Lot Current Status] = "Conditional Release",
    'board-Query'[Lot Disposition Duration]
)

Community Support Team _ Jimmy Tao

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

try this, with IN clause, it makes your code a lot cleaner  and shorter

Lot Disposition Duration 2 =
IF (
'board-Query'[Lot Current Status]
IN {
"Approved for Processing",
"Approved",
"Quarantine",
"Reject",
"Conditional Release"
},
'board-Query'[Lot Disposition Duration],
""
)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors
Top Kudoed Authors