I'm new to "M" and I have a question that I think should be pretty simple but I can't find the right answer anywhere.

I am connected to a SharePoint List through Power BI and a few of the columns in the data set are coming across like this:

<div class="ExternalClass7DF52B6F7B0440629625A19FD571B46D"><p>​xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p></div>

I changed the text to "X's" for confidentiality. Anyway, How can I remove all the HTML script from all these columns and rows so that it just gives me the comments? I can't find anything about how to remove this from the entire data set so I'm hoping someone here can help.

I also have a column or two with <?xml> tags too, but should also only show the comments between the <> tags.


  • SharePoint list items expose a collection called FieldValuesAsText, which will contain plain-text values for all fields including rich text fields. In your M query, select and expand that collection and instead use FieldValuesAsText.YourRichTextColumn – sasfrog Aug 6 '19 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.