Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I am trying to create a new column (two actually) that will return the total number of booked rooms Canceled from my database. The total number of booked rooms = number of rooms times number of nights - in my case [NumRms]*[Number of nights]. I also have a status column to find my canceled or no show rooms... [Status]="CXL" and [Status]="no show". If the status is anything except CXL or no show, I need the row to be "0". But my IF formula keeps giving me a Token Else expected. Not sure what I am missing:
Solved! Go to Solution.
Hi @hermesgoddess,
In addition, you can also use DAX to add a new calculate column in your table under Modeling tab in this scenario. The formula below is for your reference. ![]()
CANCELED =
IF (
'Table1'[Status] = "CXL"
|| 'Table1'[Status] = "no",
'Table1'[Num Rms] * 'Table1'[Number of nights],
0
)
Note: Just replace 'Table1' with your table name.
Regards
Hi @hermesgoddess,
In addition, you can also use DAX to add a new calculate column in your table under Modeling tab in this scenario. The formula below is for your reference. ![]()
CANCELED =
IF (
'Table1'[Status] = "CXL"
|| 'Table1'[Status] = "no",
'Table1'[Num Rms] * 'Table1'[Number of nights],
0
)
Note: Just replace 'Table1' with your table name.
Regards
Try and replace "then if" by "or ".
Are you sure about the double quotes around the "0"?
I would expect just number 0, not text "0".
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 71 | |
| 50 | |
| 47 | |
| 44 |