Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
My Input is like so:
I need to define 'd', 'e' and 'f' under a singular category and let everything else remain the same. So, somthing like If input is 'a', 'b' and 'c', then no change else mark them as 'h' or If my input is not 'a','b' or 'c', then rename them as 'h'.
Output -
How do I do this using DAX in an efficient manner?
Thanks for the help!:)
P.S: There are many more rows with different that need to be defined under 'h', values for 'a','b' and 'c' are same everywhere.
Solved! Go to Solution.
If statements are good, but dont give you the ability to cleanly expand. I would go with something similiar to Freeman, but as such...
Column =
SWITCH(TRUE()
, IF ( [ColumName] IN {"a","b","c"}, [ColumName]
, "h"
)
You can keep adding rules.....
Column =
SWITCH(TRUE()
, IF ( [ColumName] IN {"a","b","c"}, [ColumName]
, IF ( [ColumName] IN {"e","f"}, "g"
, "h"
)
Thank you so much! The solution above worked, the [ColumnName] before, "h" is necessary to complete the query 🙂
Hi,
Not 100% sure of your request but I'll give a try :
Test Column = IF ( [ColumName] IN {"d","e","f"}, "h" )
If you have many tests, you should consider using SWITCH function,
or if you have many many tests, even consider in making a correpondance table and use merge of queries.
Hope it helps, let us know
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |