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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
non23
Helper I
Helper I

Parse issue - DataFromat.Error

Hey guys,

Is there a way to get the value for WHATIWANTTOGET which is 12345 using DAX? Tried to parse the column via Power Query but I'm getting "DataFormat.Error" We reached the end of the buffer.

 

[{"xxx":"UNA","xxx":"21","xxx":"UNA","xxx":"aaa","xxx":"1","xxx":"2","xxx":"12","WHATIWANTTOGET":"12345","XXX":"1234","XXX":"UNA","XXXX":"UNA"}]

 

Note that the position always changes. Only keyword is WHATIWANTTOGET.

1 ACCEPTED SOLUTION

Hi! @non23 

 

You can use this m-code for your solution and once you get the new column you might have to clean that a bit.

 

AnkitKukreja_2-1725625398291.png

 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fY8xD4JADIX/iulMSLgTBrcGizBwxKMX1DsGdwdXY/zvwqHGDppO7+tL36v3kKX+HgBLDrAJcL2cbwGSCVjCSJzBCAy2JADupO7pIDUju16gzm7JCjLUyM2AZknX+XqaIo+rytLe0Wvz9pedM2yP8gYh1993HyOMiQeVrubXZESm9JTw8ejF0zC1f3rNnQqlfzY4dYZk/PgE", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Test = _t]),
#"Inserted Text Between Delimiters" = Table.AddColumn(Source, "Text Between Delimiters", each Text.BetweenDelimiters([Test], """WHATIWANT"":""", """"), type text)
in
#"Inserted Text Between Delimiters"

 

 

 

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

View solution in original post

5 REPLIES 5
ValtteriN
Super User
Super User

Hi,

I placed the value provided into a column:

ValtteriN_0-1725601402193.png

Now this measure gets the value:

Get value =
VAR JsonString = MAX('Table (40)'[Column1])
VAR StartPos = SEARCH("WHATIWANTTOGET"":""", JsonString, 1) + LEN("WHATIWANTTOGET"":""")
VAR EndPos = SEARCH("""", JsonString, StartPos)
RETURN MID(JsonString, StartPos, EndPos - StartPos)


End result:
ValtteriN_1-1725601433356.png

 

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks for this! However, the var JsonString is getting the maximum value for the whole lot. Is there a way to get the one for the row instead? Tried the formula you've shared but it only has one value for all.

Can you elaborate a bit? Are there multiple values? 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Yes, there are multiple values. Please see the below samples:

1.[{"ACT":"play","AREA":"UNA","NAME":"UNA","AGE":"UNA","SEX":"UNA","STATUS":"UNA","ORDER":"UNA","WHATIWANT":"35454565","FREQUENT":"UNA","COUNTRY":"UNA","WEATHER":"UNA"}]
2. [{"WHATIWANT":"123456"}]
3. [{"ITEM":"UNA","WHATIWANT":"4565623","COUNTRY":"UNA","ZONE":"UNA"}]

Hi! @non23 

 

You can use this m-code for your solution and once you get the new column you might have to clean that a bit.

 

AnkitKukreja_2-1725625398291.png

 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fY8xD4JADIX/iulMSLgTBrcGizBwxKMX1DsGdwdXY/zvwqHGDppO7+tL36v3kKX+HgBLDrAJcL2cbwGSCVjCSJzBCAy2JADupO7pIDUju16gzm7JCjLUyM2AZknX+XqaIo+rytLe0Wvz9pedM2yP8gYh1993HyOMiQeVrubXZESm9JTw8ejF0zC1f3rNnQqlfzY4dYZk/PgE", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Test = _t]),
#"Inserted Text Between Delimiters" = Table.AddColumn(Source, "Text Between Delimiters", each Text.BetweenDelimiters([Test], """WHATIWANT"":""", """"), type text)
in
#"Inserted Text Between Delimiters"

 

 

 

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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