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! Learn more
Hi,
I have observations that need to be categorised into their rating groups, being "Positive", "Neutral", "Negative" and "Unknown" based on some of the descriptions within the variable.
I need "Innovation" and "Exceeding company standards" to be in Positive, "Company standard" to be Neutral, "Unknown" to be Unknown, and the rest to be in Negative. This is coming from the variable [CategoryTypeName] within the "HSE Observation" field. I have attempted at writing the DAX for this but if I could receieve any help for where I went wrong it would be hugely appreciated.
Observation Category Rating = VAR ObservationCategories = FILTER(ALL('HSE Observation'[CategoryTypeName]) RETURN SWITCH(TRUE(), ObservationCategories = "Innovation"||"Exceeding Company Standards", "Positive", ObservationCategories = "Company Standard", "Netural", ObservationCategories = "Unknown", "Unknown", "Negative") |
I cannot use Data Groups or Power Query so has to be a DAX. Thank you.
Hi @BotBot1
in which table are creating this column? What is the relationship between this table and 'HSE Observation'?
Hi @tamerj1,
I'm not too sure on this, but I am connected to a live dataset (SQL) whereby HSE Observation is the field and CategoryTypeName is one of the variables within the field. I have a measure of 'count of observations' which is where I want to get the number of positive/neutral/negative/unknown ratings from. I currently have a pie chart where it breaks it down the approx. 15 different category names (e.g. company standard, innovation...), but I just want to categorise these into the 4 ratings. I hope this helps, thanks
hi @BotBot1
Try like:
Hi @FreemanZ,
Thanks for this. I recieve the below message when inputting this. I am not sure how to but if I could have a COUNT be added to get the total number per new category that would be great, thank you.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |