Forum Discussion
C4L84
Advocate II
4 years agoAddcolumn 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
Community Champion
4 years agoC4L84 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
In case it answered your question, please accept the solution to help other members find it. Appreciate Your Kudos.
SpartaBI Logo
Visit SpartaBI website Visit SpartaBI Linkdin Visit SpartaBI Facebook
Showcase Report – Contoso By SpartaBI
- C4L844 years ago
Advocate 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 ago
Advocate 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.