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.
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!
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 |
---|---|
97 | |
94 | |
74 | |
71 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |