The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a column where the values look like ////XXX///. The "/" represent 5 minutes for one provider and the "X" represents 15 min for another. How can I create a new column with the actual time these characters represent?
Solved! Go to Solution.
@czuniga you can simply do this
@czuniga so ////XXX/// should equate to 80 minutes ?
Yes, exactly
@czuniga would be happy with a PQ solution
let
regex=let fx=(input)=>
Web.Page(
"<script>
var x='"&input&"';
var b =(x.match(/\//gm)).length*5+(x.match(/x/gmi)).length*15; document.write(b);
</script>"){0}[Data]{0}[Children]{1}[Children]{0}[Text]
in
fx,
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W0geCiIgIIKkUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each regex([Column1])),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Custom", Int64.Type}})
in
#"Changed Type1"
Thank you for this. I'm not super familar with using the advanced editor. What would I use if I just wanted to add a column to an existing workflow?
@czuniga you can simply do this
HI @czuniga ,
Not sure what you are trying to ask here. Please add more details here like screenshots, some sample data, etc. ?
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Thanks,
Pragati
Just edited!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
78 | |
70 | |
52 | |
50 |
User | Count |
---|---|
120 | |
120 | |
76 | |
62 | |
61 |