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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
rds_2019
Helper I
Helper I

Pick up Dates from initial rows as a column

Hi All,

I have got data in below shape:-

 

Data is Important
Data is  blah blah
Data is since 01/01/2019
   
Column1Column2Column3
poaa22
lkbb3

 

I want to do below 2 things:-

a. Avoid first 4 rows since they are not part of data, just an information.

b. Still use date in 3rd row-01/01/2019 as 4th column. So that it can b used in Reporting.

 

Can this be done.

 

Regards,

RDS 

 

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@rds_2019 

 

Hi,

Please see if this useful. File attached as well

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckksSVTILFbwzC3ILypJzCtR0lECoVgduNyhBQpJOYkZYAJTVqE4My85VcHAUB+IjAwMLZGUIDGd83NKc/MMgVwIywjOMgbLF+QDBRITgYSREVggJxvITkoCEkAFsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",4),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
    #"Added Custom" = Table.AddColumn(#"Promoted Headers", "Date", each Text.AfterDelimiter(#"Changed Type"{2}[Column1], " ", {0, RelativePosition.FromEnd}))
in
    #"Added Custom"

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

@rds_2019 

 

Hi,

Please see if this useful. File attached as well

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckksSVTILFbwzC3ILypJzCtR0lECoVgduNyhBQpJOYkZYAJTVqE4My85VcHAUB+IjAwMLZGUIDGd83NKc/MMgVwIywjOMgbLF+QDBRITgYSREVggJxvITkoCEkAFsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",4),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
    #"Added Custom" = Table.AddColumn(#"Promoted Headers", "Date", each Text.AfterDelimiter(#"Changed Type"{2}[Column1], " ", {0, RelativePosition.FromEnd}))
in
    #"Added Custom"

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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