Power Bi Feature Series – Add column by example
This feature allows you to create new columns of data from existing columns or clean data in your data model. It allows you to add new columns of data to your model by simply providing one or more sample values for your new column. Using columns by example allows you to complete transformations on data without needing to know the formulas. Examples of this could be trimming blank spaces, getting just part of a string, or concatenating data from different columns. In more complex examples you need to provide a power query with a few examples, so it can learn what you are trying to do.
How to use this feature:
Use Query Editor
Click Add column
B. Choose column by example
C. Select from all columns or from the selection. This will add a new column
As you type, it will show you a preview of the transformation that will be applied. In the example below, you will see that we are extracting everything before the - character in CUSTCLAS using the Text before the delimiter transformation.
You will then have to rename the column
This is a nice tool for cleaning data quickly and the best thing is that it also works in excel using power query. If you would like to learn more reach out to the GP support team.