Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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".
User | Count |
---|---|
130 | |
108 | |
101 | |
67 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |