Forum Discussion
C4L84
4 years agoAdvocate II
Addcolumn with if statement
Hi community, I'm looking for some help with an ADDCOLUMN expression. I need to add a new column called "RevenueType" in the BookingStatus table which groups BookingCodes A, R, H and CX as "C...
C4L84
4 years agoAdvocate II
SpartaBI I need to specifically use the ADDCOLUMN funtion, something like this:
RevenueType =
ADDCOLUMNS('Booking statuses',"RevenueType",
IF(MIN('Booking statuses'[BookingCode]) in {"A","R","H","CX"}, "Confirmed revenue", "Provisional")
)
But I am getting this error message:
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
Ivn_rmr
3 years agoNew Member
Hi, I know it has been a while since you posted your question. Did you come across with any solution? I am having the same issue.
- tamerj13 years agoCommunity Champion
Hi Ivn_rmr
Please explain your issue perhaps I can help.With regard to this particular question, I can see that SpartaBI already provided a workable solution. However, the request of using ADDCOLUMNS function as per C4L84 is not clear as ADDCOLUMNS returns a table not a scalar value.