Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 "Confirmed revenue" with all remaining codes as "Provisional".
Here is a pbix example.
I've got as far as creating the if statement:
It should be noted that this has to be a DAX expression and the data cannot be modified in the query editor.
I'm hoping someone in the community can help as I've been stuck on this for some time!
I am not sure that you need to use the addcolumn function for this but if you really need to let me know.
I achieved what you are looking for by adding a new column as shown below:
Then I inputted the following in the formula bar:
RevenueType = IF('Booking statuses'[BookingCode] in {"A","R","H","CX"},"Confirmed Revenue", "Provisional")
@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
Thanks for replying @SpartaBI
I need to add a new column to the BookingStatus table using DAX, which uses the IF statement.
@SpartaBI I need to specifically use the ADDCOLUMN funtion, something like this:
@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"))
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.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |