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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Manichin
Frequent Visitor

How to extract specific key value pair from a comma separated key values

I have a usecase where i need to split only workspacename from a key value pairs that i got thrugh power shell scripts. The input source for the power bi file is Excel where we have a column for this keyvaluepair. sample value as follows,
{"Id":"cd23f0f1-9d51ac05","RecordType":10,"CreationTime":"2023-03-30T17:33:04","Operation":"AnalyzedByExternalApplication","OrganizationId":"a29a75-4a46-9395-6fa91e6e7751","UserType":0,"UserKey":"10032001371E1CB1","Workload":"PowerBI","UserId":"Landon.Jordan@deepwater.com","ClientIP":"174.9.9.58","UserAgent":"MSOLAP 16.0 Client","Activity":"AnalyzedByExternalApplication","ItemName":"Power BI Desktopee42fb16-91e2-494c-8bc2-ab6bbef00ab6","WorkSpaceName":"Sample - Dev","DatasetName":"SampleModel","ObjectId":"Power BI Desktopee42fb16-91e2-494c-8bc2-ab6bbef00ab6","DatasetId":"7c457a4f-f-71e9beefb333","IsSuccess":true,"RequestId":"7a4-4239-9ad1-5c18476a1506","ActivityId":"DFFBD35F-576E-4F2F-9F56-5F533CA71411"}.

These key value pairs or not standard. each records has different count of key-value pairs and the order is different. i need to get only workspace name from this.

Manichin_1-1680274223508.png

Anyone please suggest how to get the workspace name.
Thank you

 

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Manichin ,

 

You need to split twice.

1.Split the column by custom text: "WorkSpaceName":"

vstephenmsft_1-1680575259833.png

vstephenmsft_2-1680575294068.png

vstephenmsft_0-1680575208258.png

vstephenmsft_3-1680575357905.png

 

2.Remove [Column1.1]. Split the [Column1.2] by """ and split at left-most delimiter.

vstephenmsft_4-1680575405088.png

vstephenmsft_6-1680575530819.png

3.[Column1.2.1] is the wrokspace name, remove [Column1.2.2] and rename [Column1.2.1].

vstephenmsft_7-1680575602085.png

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

View solution in original post

1 REPLY 1
v-stephen-msft
Community Support
Community Support

Hi @Manichin ,

 

You need to split twice.

1.Split the column by custom text: "WorkSpaceName":"

vstephenmsft_1-1680575259833.png

vstephenmsft_2-1680575294068.png

vstephenmsft_0-1680575208258.png

vstephenmsft_3-1680575357905.png

 

2.Remove [Column1.1]. Split the [Column1.2] by """ and split at left-most delimiter.

vstephenmsft_4-1680575405088.png

vstephenmsft_6-1680575530819.png

3.[Column1.2.1] is the wrokspace name, remove [Column1.2.2] and rename [Column1.2.1].

vstephenmsft_7-1680575602085.png

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors
Top Kudoed Authors