Forum Discussion
Add a conditional Column with two conditions
Hi I am a power BI beginner, I want to create a new conditional column in table below so that contracttype "Contract" with days as 1 change to "Per Diem", while rest all remain the same?
Input:
ContractType Days
| Per Diem | 5 |
| Contract | 1 |
| Contract | 5 |
| Contract | 4 |
| Contract | 7 |
| Per Diem | 1 |
| Per Diem | 2 |
| Per Diem | 3 |
| Per Diem | 4 |
| Contract | 1 |
| Contract | 1 |
| Permanent | 30 |
Expected Output:
ContractType Days New Type
| Per Diem | 5 | Per Diem |
| Contract | 1 | Per Diem |
| Contract | 5 | Contract |
| Contract | 4 | Contract |
| Contract | 7 | Contract |
| Per Diem | 1 | Per Diem |
| Per Diem | 2 | Per Diem |
| Per Diem | 3 | Per Diem |
| Per Diem | 4 | Per Diem |
| Contract | 1 | Per Diem |
| Contract | 1 | Per Diem |
| Permanent | 30 | Permanent |
Hi manish_tripathi,
You can use:
New Type = IF('Table'[Contract Type]="Contract" && 'Table'[Days]=1, "Per Diem", 'Table'[Contract Type])Works for you? Mark this post as a solution if it does!
Check out this post of mine: Forecast Period - Previous Forecasts
Spare some time to read: How to Export Telemetry Data from Azure IoT Central into Power BI
2 Replies
- ShauryaMemorable Member
Hi manish_tripathi,
You can use:
New Type = IF('Table'[Contract Type]="Contract" && 'Table'[Days]=1, "Per Diem", 'Table'[Contract Type])Works for you? Mark this post as a solution if it does!
Check out this post of mine: Forecast Period - Previous Forecasts
Spare some time to read: How to Export Telemetry Data from Azure IoT Central into Power BI- manish_tripathiFrequent Visitor
Thank you