Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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!!!
Solved! Go to Solution.
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],
""
)
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.
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], "" )))))
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],
""
)
User | Count |
---|---|
118 | |
66 | |
65 | |
56 | |
50 |
User | Count |
---|---|
182 | |
85 | |
67 | |
61 | |
53 |