Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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!
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
102 | |
68 | |
45 | |
37 | |
36 |