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...
SpartaBI
4 years agoCommunity Champion
C4L84 do you mean like this?
RevenueType = IF('Booking statuses'[BookingCode] in {"A","R","H","CX"}, "Confirmed revenue", "Provisional")
Here is a link to download the file with the solution:
Addcolumn with if statement 2022-08-02.pbix
C4L84
4 years agoAdvocate II
Thanks for replying SpartaBI
I need to add a new column to the BookingStatus table using DAX, which uses the IF statement.
- C4L844 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_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.