March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All,
I am trying to extract the text between the Hypen
#"Device Names" = Table.AddColumn(Source, "Device Name", each Text.BetweenDelimiters([Device Name], "-", "-"), type text)
Result should be like below wherever the text not between Hyphen then it should be 0 or null
Regards
Sathya
Hi @Sathyabalan ,
if you have a max occurence of 2 hyphens, you can try to first split you column on the right-most delimiter. And then split the left part based on the left-most identifier:
In the advaced editor, this becomes:
#"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Original text", "Original text - Copy"),
#"Split Column by Delimiter" = Table.SplitColumn(#"Duplicated Column", "Original text - Copy", Splitter.SplitTextByEachDelimiter({"-"}, QuoteStyle.Csv, true), {"Original text - Copy.1", "Original text - Copy.2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Original text - Copy.1", type text}, {"Original text - Copy.2", type text}}),
#"Split Column by Delimiter1" = Table.SplitColumn(#"Changed Type1", "Original text - Copy.1", Splitter.SplitTextByEachDelimiter({"-"}, QuoteStyle.Csv, false), {"Original text - Copy.1.1", "Original text - Copy.1.2"}),
#"Changed Type2" = Table.TransformColumnTypes(#"Split Column by Delimiter1",{{"Original text - Copy.1.1", type text}, {"Original text - Copy.1.2", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type2",{{"Original text - Copy.1.2", "Result"}}),
#"Replaced Value" = Table.ReplaceValue(#"Renamed Columns",null,"0",Replacer.ReplaceValue,{"Result"}),
#"Reordered Columns" = Table.ReorderColumns(#"Replaced Value",{"Original text", "Result", "Original text - Copy.1.1", "Original text - Copy.2"})
Good luck!
Hi @Smalfly Good Day!
I am using Power Bi Service where this options not available in GUI and the Advanced Editor as well, so looking for a function to create an addtional column, even We found a way to it by running the below Dax Function
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
23 | |
12 | |
11 | |
8 |
User | Count |
---|---|
46 | |
44 | |
24 | |
12 | |
10 |