Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi Team,
I need to show the data from different tables and among them url is one fof the column. Actually i am splitting the column (that is url column) by "/" .but some times if "/" is not present in the url ,it is showing the column as blank.
My issue is splitting the url based on some condition .
I need to split the url based on the top most right one.if that is not present it should not split.
example 1: http://microsoft.com/en-us
in this case result should show the en-us
example 2: http://microsoft.com
in thi case result should show complete url like http://microsoft.com
Thanks in advance.
Hi @vsatamraju,
You can also use dax query to achieve your requirement:
Table:
Calculate column:
RightPart = if(LEN([Url])<=LEN("http://microsoft.com"),[Url],RIGHT([Url],LEN([Url])-LEN("http://microsoft.com/")))
Result:
Regards,
Xiaoxin Sheng
Hi, this "M" code could help you to achieve.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WyigpKbDS188sT87XS87XT0xKVorVQRdWio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","//","||",Replacer.ReplaceText,{"Column1"}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Replaced Value","Column1",Splitter.SplitTextByDelimiter("/", QuoteStyle.Csv),{"Column1.1"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Column1.1", type text}}),
#"Replaced Value2" = Table.ReplaceValue(#"Changed Type1","||","//",Replacer.ReplaceText,{"Column1.1"})
in
#"Replaced Value2"
Regards
Rather than using the split columns method, I'd recommend writing a custom column to check conditions and copy the appropriate string.
Proud to be a Super User!
User | Count |
---|---|
98 | |
90 | |
78 | |
72 | |
65 |
User | Count |
---|---|
114 | |
97 | |
95 | |
68 | |
65 |