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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
MF_BI
Regular Visitor

Split Column type in Power Query Editor

Hello all,

 

I have a table in Power Query like this one below :

Typevalue
DurationPT10M
Integer8
DurationrPT13H
DurationrPT30M
DurationrPT50S
Integer14

 

and I want to Split the column Value in two columns : Value duration and Value integer depended from type like this table below : 

Typevaluevalue duration value integer
DurationPT10MPT10M 
Integer8 8
DurationrPT13HPT13H 
DurationrPT30MPT30M 
DurationrPT50SPT50S 
Integer14 14

 

Any one have Idea how I can do that ? Thank you.

 

Best,

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @MF_BI ,

 

yes, you can do that by checking the format of the row with Value.Is and Value.FromText.

Here my full example:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WciktSizJzM9T0lEKCDE08FWK1YlW8swrSU1PLQKKWYD5MEVFEFXGHlhEjaF6UUVNDYLRTDQ0UYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Type = _t, value = _t]),
    #"Added Custom" = Table.AddColumn(Source, "value integer.1", each if Value.Is(Value.FromText( [value] ),type number) 
then Value.FromText( [value] )
else null),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "value duration", each if not Value.Is(Value.FromText( [value] ),type number) 
then [value]
else null)
in
    #"Added Custom1"

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @MF_BI ,

 

Does the replies above solve your problem? If it has been solved, please mark the correct reply as the standard answer to help the other members find it more quickly.Thank you very much for your kind cooperation!

 

Hope it helps,


Community Support Team _ Caitlyn

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

selimovd
Super User
Super User

Hey @MF_BI ,

 

yes, you can do that by checking the format of the row with Value.Is and Value.FromText.

Here my full example:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WciktSizJzM9T0lEKCDE08FWK1YlW8swrSU1PLQKKWYD5MEVFEFXGHlhEjaF6UUVNDYLRTDQ0UYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Type = _t, value = _t]),
    #"Added Custom" = Table.AddColumn(Source, "value integer.1", each if Value.Is(Value.FromText( [value] ),type number) 
then Value.FromText( [value] )
else null),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "value duration", each if not Value.Is(Value.FromText( [value] ),type number) 
then [value]
else null)
in
    #"Added Custom1"

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.