Forum Discussion
How to modify my expression to make it easy add new code for recode ?
Hi All
Can some one share with me how to simplify the code , so that when i add new pro_class_code , i don't need to add :-
- Anonymous5 years ago
hi admin11 - A better approach would be to maintain the code to desription mapping in a DIMENSION table and perform a lookup and ro derive the description for the code from the DIMENSION table. This was when a new code comes in you need to just add it to the DIMENSION table and all records for the corresponding code will have the new value.
Please vote / mark this response as a solution if this helps you. This will also help other community members who may have a similar question.
Happy to help!
4 Replies
- daxer-almighty
Solution Sage
It's easy when you do it where it should be done: in Power Query. Data wrangling should never be done in DAX since DAX has a very different purpose in life. DAX = Data Analysis eXpressions. To do data wrangling you should use M---the language that Power Query speaks. If you do that, the maintenance cost will be minimal.
- AnonymousNot applicable
hi admin11 - A better approach would be to maintain the code to desription mapping in a DIMENSION table and perform a lookup and ro derive the description for the code from the DIMENSION table. This was when a new code comes in you need to just add it to the DIMENSION table and all records for the corresponding code will have the new value.
Please vote / mark this response as a solution if this helps you. This will also help other community members who may have a similar question.
Happy to help!