Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
karsb23
Regular Visitor

How to handel RTF columns using Power Query

Dear all,

 

I use the ODBC data source to connect to a Firebird database.

This database contains a fact-table called AT_DOCUMENT which has a column (GC_INFORMATIE) with a BLOB (binary) value.

I was able to transfromt the BLOB value to a string using the following code:

= Table.TransformColumns(Bron,{{"GC_INFORMATIE",Text.FromBinary},{"REPLACE",Text.FromBinary}})

 

This results for example in the following value:

"{\rtf1\ansi\deff0{\fonttbl{\f0\fnil Segoe UI;}}
\viewkind4\uc1\pard\lang1043\f0\fs18 This is a note\par
}
"

I searched all over the internet but I cannot seem to find (1) a way to remove the RTF-tags or (2) a way to use the formatted text in a table.

 

I have limited knowledge about languages outside of Power Query M or Dax but I tried to convert the data from BLOB in the following SQL statement, unfortunately I still get the string with the RTF-tags

SELECT  D.GC_INFORMATIE,
        CAST(SUBSTRING(GC_INFORMATIE FROM 1 FOR 32000) AS VARCHAR(32000)) AS GC_INFORMATIE2
FROM    AT_DOCUMENT D

Can someone help me out with this?

 

Many thanks in advance.

7 REPLIES 7
Syndicate_Admin
Administrator
Administrator

Dangit gents, I have the same challenge! 

 

Will update if I find something aswell.. 

We are now setting up an datawarehouse in order to transform the data to plain text instead of doing it all in Power Query.

veikko
Frequent Visitor

Hello,

I am facing the same problem and I haven't found any solution to that yet. @karsb23 did you figure this out already? 

Hi @veikko,

 

Unfortunately no. If I figure something out, I will let you know.

 

Hello @karsb23, I saw your comment about setting up a datawarehouse solution in order to get rid of the RTF tags. Did you manage to get only the plain text with that solution? If so, I would be interested to hear about the solution in general level. 

karsb23
Regular Visitor

Dear @v-yalanwu-msft ,

 

Thank you for your response.

I have the type detection allready enabled and the type of the GC_INFORMATIE is set to TEXT.

Unfortunately this does not process the RTF-tags:

karsb23_0-1665468921639.png

 

Any other ideas where I can find the solution?

Thank you again!

 

v-yalanwu-msft
Community Support
Community Support

Hi, @karsb23 ;

First, please check if the "Type Detection" has been set as "Always detect column types and headers for unstructured sources" or "Detect column types and headers for unstructured sources according to each file's setting".

vyalanwumsft_0-1665467988421.png

If this has been set, try to detect data type manually like this:

vyalanwumsft_1-1665468017662.png

Reference:Rich Text format issue while fetching data from pr... - Microsoft Power BI Community


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors