Forum Discussion
ianbruckner
7 years agoFrequent Visitor
Remove text between html tags
I'm looking for help to remove html tags from a string. Example input: <div class="ExternalClass742C332E0D0340C598BC9A78413A04DE">Staff going to storage training</div> Desired output: Staff goin...
- 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
)
Pascal_KTeam
Resolver I
5 years agoRemoving HTML tasks can be a daunting task, I had to do this as well and it always needed some maintenance as new cases were coming in. As an alternative, why don't you just use a custom visual that can actually deal with HTML?
Take a look at the HTML Text Styler visual which you can get from the AppSource: https://appsource.microsoft.com/en-us/product/power-bi-visuals/wa200002071?tab=overview