Forum Discussion
Convert number with text to number
- 3 years ago
Hi SenoirB
I modified AntrikshSharma 's solution as below. You can use this code to create a custom column.
let result = Text.Replace ( Text.Replace ( Text.Replace ( Text.Replace ( [Time], " ", "" ), "h", "*60+" ), "m", "*1+" ), "s", "/60" ) in if Text.EndsWith(result, "+") then Expression.Evaluate(Text.Range(result, 0, Text.Length(result)-1)) else Expression.Evaluate(result)Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Thank you for the response. I may have left out some details. I copy and paste the data into Sharepoint, so the report's data source is from Sharepoint. I was entering your code in a Custom Column formula, I don't think that is correct either because it was creating a Table in the Added Column for each entry. Sorry I am really new to Power Queries and Power BI. But your result in Total Minutes is exactly what I am after.
- AntrikshSharma3 years ago
Community Champion
SenoirB My code is query so it will return a table, you need to use the AddedCustom step and create a new step in your code. Otherwise just paste the whole code in a blank query and you can see how it works.