Forum Discussion
clo_64
3 years agoFrequent Visitor
How can I split an excel sheet containing 3 tables in Power Query (Power BI)
Hi, I'm trying to find a way to split one excel sheet which contains 3 tables with dynamic sizes in 3 separate tables to work independently on them in Power BI. The spreadsheet looks like: Curr...
- 3 years ago
Hi clo_64
I have create a sample file attached at bottom. There are three queries in the sample. Their only difference is the last step to filter rows.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wci4tKkrNK1Fwzs8rLs1NLSpWitUBiRaXKDgeWqAAQ0bGJggJJyQJQ0NThIQzkoSlOVgcTPillmOzwAWu3BSh1jkxLzk1JzUFmwZXJPPNsZljaKQUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]), #"Added Index" = Table.AddIndexColumn(Source, "Index", 0, 1, Int64.Type), #"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each if [Column1]="" then [Index] else null), /* The following three steps are all based on the result of "Added Custom" step */ firstBlankRow = List.Min(Table.Column(#"Added Custom", "Custom")), secondBlankRow = List.Max(Table.Column(#"Added Custom", "Custom")), #"Filtered Rows" = Table.SelectRows(#"Added Custom", each [Index] < firstBlankRow) in #"Filtered Rows"Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!
clo_64
3 years agoFrequent Visitor
Thanks for the code! Great stuff with the ranking... I'm pretty good in DAX but M is still new to me