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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

xml.document

Hello,  One of the column I have is an xml type.

 

It contains information as follow:

 

<?xml version="1.0" encoding="utf-16"?>
<string><DLTKVisionMessage><ReturnCode>ErrDataVal</ReturnCode><ReturnDesc>Data Validation Error</ReturnDesc><Detail><ValidationResult>
<Message>
<Table>EMAllCompany</Table>
<Column>Org</Column>
<ColValue>1-CO-000-048</ColValue>
<RowNum>1</RowNum>
<PrimaryRecKeyVal>64122</PrimaryRecKeyVal>
<MsgCode>VAL1001</MsgCode>
<MsgDesc>Value not in the master/code table!</MsgDesc>
</Message>
</ValidationResult></Detail></DLTKVisionMessage></string>

 

I would like to know how to import in 3 new columns, the PrimaryRecKeyVal = 64122, MsgCode=VAL1001 and MsdDesc ="Value not in the master/code table!" using DAX to obtain the following result

 

ex:

Column1        Column2    Column3

64122             VAL1001     Value not in the master/code table!

 

 

1 ACCEPTED SOLUTION
ElenaN
Resolver V
Resolver V

Hello,

 

In Power Query you can add a new column for each case using the following formula:

 

= Text.BeforeDelimiter(Text.AfterDelimiter([Column1], "<MsgCode>"), "</MsgCode>")

For each column you have to modify the search text accordingly.

 

Regards,

ElenaN

View solution in original post

3 REPLIES 3
ElenaN
Resolver V
Resolver V

Hello,

 

In Power Query you can add a new column for each case using the following formula:

 

= Text.BeforeDelimiter(Text.AfterDelimiter([Column1], "<MsgCode>"), "</MsgCode>")

For each column you have to modify the search text accordingly.

 

Regards,

ElenaN

Anonymous
Not applicable

Hello,

 

Thanks for the solution.  It seems to work well.  Do you have the equivalent function in DAX?

@Anonymous ,

 

You may refer to the post below.

https://community.powerbi.com/t5/Desktop/retrieve-text-string-from-cells-in-excel/m-p/305533#M135131

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.