Forum Discussion
Addcolumn with if statement
SpartaBI I need to specifically use the ADDCOLUMN funtion, something like this:
- Ivn_rmr3 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.
- Vasuno13 years agoFrequent Visitor
C4L84 - Sorry I didn't realize that you reiterated your absolute need to use the ADDCOLUMNS function (nor did I notice that someone already posted the exact solution I did 😞)
C4L84 / Ivn_rmr - I used the below formula to create the table using the ADDCOLUMNS function:
RevenueType = ADDCOLUMNS('Booking statuses',"RevenueType",IF('Booking statuses'[BookingCode] in {"A","R","H","CX"},"Confirmed Revenue", "Provisional"))