Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi there,
I have a column in text format as below:
Duration |
9m 44s |
10m 8s |
36s |
2m |
I want to show the values in power bi chart, can anyone support. thanks in advance
Hi @VahidDM
Maybe you can try some m code like the following:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WssxVMDEpVorViVYyNMhVsIAwjc0gtFGuUmwsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Duration = _t]),
#"Added Custom" = Table.AddColumn(Source, "Custom", each if Text.Contains([Duration],"m") then [Duration] else " "&[Duration]),
#"Split Column by Delimiter" = Table.SplitColumn(#"Added Custom", "Custom", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, false), {"Custom.1", "Custom.2"}),
#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Duration", type text}, {"Custom.1", type text}, {"Custom.2", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","m","",Replacer.ReplaceText,{"Custom.1"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","s","",Replacer.ReplaceText,{"Custom.2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value1",{{"Custom.1", Int64.Type}, {"Custom.2", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Custom.1", "m"}, {"Custom.2", "s"}}),
#"Replaced Value2" = Table.ReplaceValue(#"Renamed Columns",null,0,Replacer.ReplaceValue,{"m", "s"}),
#"Added Custom1" = Table.AddColumn(#"Replaced Value2", "value", each [m]*60+[s])
in
#"Added Custom1"
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HI @vat2do
Can you post sample of the expected output?
please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables
Appreciate your Kudos!!
LinkedIn | Twitter | Blog | YouTube
Hi,
Thanks for your response,
I need to show the same values in chart for example each bar showing value as "9m 44s" or "10m 8s" etc
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
70 | |
37 | |
29 | |
26 |
User | Count |
---|---|
91 | |
49 | |
45 | |
38 | |
37 |