New Calculated Column using IF statement or SWITCH
I have a question as to how to create a new calculcated column, based on the values of 2 columns. I'm really new to PowerBI, and to posting on this forum, so I don't know how to attach a sample dataset. I'll try to describe as best as possible.
I have 2 columns, one is Incident Type Group, and the other is Incident Type Code. There are many values for Incident Type code, and I condense it into a group depending on what number the code starts with. If the code started with a 1, it belonged to the 'Fire' group, if it started with a 3, it belonged to the 'EMS' group. Please see 'Incident Group' for more info.
1 - Fire
2 - Overpressure
3 - EMS
4 - Hazmat
5 - Service
6 - Good Intent
7 - False
8 - Severe Weather
9 - Special Incident
I would like to create a new column, named 'Monthly Incident Type', where I take into consideration the specific values above in the Incident Code.
If Incident Code is in ['13','130','131','132','133','134','135','136','137', '138'] then it equals 'Vehicle Fire'
If Incident Code is in ['322','323','324','352'] then it equals 'Vehicle Accident'
else, if Incident Code starts with 1, then 'Fire',
2, then 'Overpressure',
3, then 'EMS',
4, then 'Hazamt' and so on based on the Incident Group. Both Incident Group and Incident Code columns are type Text.