Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
Below is a picture of my raw data. I need to delineate the column into rows based on DTP or TRA.
In Excel I use the following formula, =IFERROR(LEFT(SUBSTITUTE([@[Work volume_9]],IFERROR(LEFT([@[Work volume_9]],SEARCH("DTP",[@[Work volume_9]])+4),""),""),SEARCH("Words",SUBSTITUTE([@[Work volume_9]],IFERROR(LEFT([@[Work volume_9]],SEARCH("DTP",[@[Work volume_9]])+4),""),""))-2)*1,"")
which results in
How do I replicate this in PowerBi? It can be a measure, but I prefer to have that data in columns.
Thanks for your help.
Column =
VAR dtp_position = FIND("DTP", 'Table'[Work volume_9], 1, -1) + 4
VAR substitute_string = SUBSTITUTE('Table'[Work volume_9], LEFT('Table'[Work volume_9], IF(dtp_position = -1, 0, dtp_position)), "")
VAR words_position = FIND("Words", substitute_string, 1, -1) - 2
RETURN IFERROR(LEFT(substitute_string, IF(words_position = -1, LEN(substitute_string), words_position)), "")
In this formula:
This was almost perfect. However, I need the number that proceeds DTP as the output. For example, If the column contains "36 words DTP, 45 words TRA", I would like the columns to read
| DTP | TRA |
| 36 | 45 |
Column =
VAR dtp_position = FIND("DTP", 'Table'[Work volume_9], 1, -1) + 4
VAR substitute_string = SUBSTITUTE('Table'[Work volume_9], LEFT('Table'[Work volume_9], IF(dtp_position = -1, 0, dtp_position)), "")
VAR words_position = FIND("Words", substitute_string, 1, -1) - 2
VAR number_string = SUBSTITUTE(SUBSTITUTE(substitute_string, "words", ""), " ", "")
RETURN IFERROR(VALUE(number_string), BLANK())
This one gave all blanks...
Did I edit it correctly?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |