Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I pulled data from SharePoint and some of the fields contain HTML tags. I am looking for working example. Specifically, I would like something that doesn't require me know what tags will be used in the the data in advance (dynamic solution).
//https://community.powerbi.com/t5/Desktop/Robust-function-to-remove-HTML-tags/td-p/171081
// My data is currently in a resident table called SharePointData_01
For V_Row = 1 to NoOfRows('SharePointData_01')
Let V_ID = Peek('ID',vRow-1,'SharePointData_01');
Let V_PowerBI_To_The_Rescue = Peek('Comments',vRow-1,'SharePointData_01');
do while len(TextBetween(V_PowerBI_To_The_Rescue, '<', '>'))>0
V_PowerBI_To_The_Rescue=Replace(V_PowerBI_To_The_Rescue, '<' & TextBetween(V_PowerBI_To_The_Rescue, '<', '>') & '>', '');
loop;
SharePointData_02:
load
*,
'$(V_PowerBI_To_The_Rescue)' as Comment
Resident SharePointData_01
Where ID=$(V_Row);
next V_Row;
//https://community.powerbi.com/t5/Desktop/Robust-function-to-remove-HTML-tags/td-p/171081
// My data is currently in a resident table called SharePointData_01
For V_Row = 1 to NoOfRows('SharePointData_01')
Let V_ID = Peek('ID',vRow-1,'SharePointData_01');
Let V_PowerBI_To_The_Rescue = Peek('Comments',vRow-1,'SharePointData_01');
do while len(TextBetween(V_PowerBI_To_The_Rescue, '<', '>'))>0
V_PowerBI_To_The_Rescue=Replace(V_PowerBI_To_The_Rescue, '<' & TextBetween(V_PowerBI_To_The_Rescue, '<', '>') & '>', '');
loop;
SharePointData_02:
load
*,
'$(V_PowerBI_To_The_Rescue)' as Comment
Resident SharePointData_01
Where ID=$(V_Row);
next V_Row;