Forum Discussion
Remove text between html tags
- 7 years ago
You could try using PowerQuery Text Between function and use '>' and '</' as the delimiters.
You can also do this in DAX using PATHITEM and SUBSTITUTE.
InnerHTML =
PATHITEM( // Splits the string using delimiter "|", and takes the 2nd item that is a type of Text
SUBSTITUTE( // Output <div class="Whatever"|Staff going to storage training|div>
SUBSTITUTE([Html], ">", "|"), // Output <div class="Whatever"|Staff going to storage training</div>
"</","|"
),
2,
TEXT
)
You could try using PowerQuery Text Between function and use '>' and '</' as the delimiters.
You can also do this in DAX using PATHITEM and SUBSTITUTE.
InnerHTML =
PATHITEM( // Splits the string using delimiter "|", and takes the 2nd item that is a type of Text
SUBSTITUTE( // Output <div class="Whatever"|Staff going to storage training|div>
SUBSTITUTE([Html], ">", "|"), // Output <div class="Whatever"|Staff going to storage training</div>
"</","|"
),
2,
TEXT
)
I ended up using Text.BetweenDelimiters, and it certainly stripped out the first tag. Then I found enough other tags hidden inside the input that 1, makes it impractical to state them all, and then 2, scared enough I'd lose data if I went to the lowest common denominator of > < as the delimiters alone... so I gave up. Instead, I'll probably use the HTML visualization that's filtered by a user selecting the row that contains the rest of the data. I really wish I could embed that in the table - oh well for now.
Thanks for the pointers!
- jsh1219887 years agoMicrosoft Employee
Can you give a sample input and output where multiple tags are present? Maybe use 3 layers of nested tags if you have that example?