Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
Is there a way to extract the maximum number in a string into a new column.
The number represents the number of attempts the test was conducted until I got a passing result.
Appreciate your help. Thank you in advance.
Solved! Go to Solution.
NewStep=Table.AddColumn(PreviousStepName,"Custom",each List.Count(Text.Split([StatusColumnName],","))/2)
Yes, you can use Power Query to extract the maximum number in a string and create a new column for it. Here's how:
=List.Max(List.Transform(Text.Split([ColumnName]," "), each try Int64.From(_)))
Replace "ColumnName" with the name of the column that contains the string with the number of attempts. This formula splits the string into individual words, then converts each word to an integer (if possible) and returns the maximum value.
Note: If there are non-numeric values in the string, the formula will return an error. You may need to clean the data or modify the formula to handle these cases.
Credit: ChapGPT | https://chat.openai.com/chat
NewStep=Table.AddColumn(PreviousStepName,"Custom",each List.Count(Text.Split([StatusColumnName],","))/2)
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 4 |