Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I hav a colum productName, how can I add new column Prodcutnew wich I do a substring from position4?
For example
PoductName: 01-Auto I need to dispaly Auto
Hi @Anonymous ,
We can use two ways to meet your requirement.
1. In Power Query, we can use the split column function.
2. Or we can create a calculate column to split it.
Prodcutnew =
var len__ = LEN('Table'[Product])
var location__ = FIND("-",'Table'[Product],1,0)
return
RIGHT('Table'[Product],len__ - location__)
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, there is an "Extract" option on the menu in query editor to extract with ranges. You can use that to get a formula like this:
= Table.AddColumn(#"Last Step", "Text Range Column", each Text.Middle([ColumnName], 3, 10), type text)
The 3 is the characters to avoid from the beginning and the 10 is the number of chars to consider on the rest of the string.
You can add that step in a blank one or search for "Extract" option under "Add Column" tab in query editor.
Regards,
Happy to help!
How can I put "10" total number of caracter? because I don't have the same total number of caracter for each product.
Consider adding the max number of chars that can be found on the column. If the column has less it won't matter because it will find the first, let's say 2, and extract the value. The 10 was an example.
Regards,
Happy to help!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
78 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |