Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
I am working with an Excel sheet which has multiple sections below a table that I need to work with. On PowerBI, I only need to read the data from the table located on top and ignore everything after the latest row of the top table. Detailed in the picture below. Are there any transformations I can do in Power BI import-->Transformations to do this ? Thanks
Solved! Go to Solution.
Hi @gsksarepta ,
I'd import the worksheet in PQ and find the position of the cell with Symbol/Trend text string. I would then keep the top rows based on the cell position -1. Remove the blanks from the date column and apply other transformations after.
Please see sample M-script and screenshots below:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDUByIjAyNjpVgdINcIlWuMyjVB5Zqics1QueaoXAtUriUK19AAlYvqKkNUVxmiugobgaYkuDI3KT9HP6QoNS9FKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type text}}),
Position = List.PositionOf(#"Changed Type"[Date],"Symbol/Trend")-1,
Custom1 = #"Changed Type",
#"Kept First Rows" = Table.FirstN(Custom1,Position),
#"Filtered Rows" = Table.SelectRows(#"Kept First Rows", each [Date] <> null and [Date] <> "")
in
#"Filtered Rows"
Hi @gsksarepta ,
I'd import the worksheet in PQ and find the position of the cell with Symbol/Trend text string. I would then keep the top rows based on the cell position -1. Remove the blanks from the date column and apply other transformations after.
Please see sample M-script and screenshots below:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDUByIjAyNjpVgdINcIlWuMyjVB5Zqics1QueaoXAtUriUK19AAlYvqKkNUVxmiugobgaYkuDI3KT9HP6QoNS9FKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type text}}),
Position = List.PositionOf(#"Changed Type"[Date],"Symbol/Trend")-1,
Custom1 = #"Changed Type",
#"Kept First Rows" = Table.FirstN(Custom1,Position),
#"Filtered Rows" = Table.SelectRows(#"Kept First Rows", each [Date] <> null and [Date] <> "")
in
#"Filtered Rows"
Ideally format the data range you want to import as a table in excel as it sounds like it is currently just a range not a table, then just import the table in Power Query rather than the worksheet. You'd need to check this doesn't impact the other data etc. below though, so save a backup first!
Alternatively, based on your screenshot, if you expect no further date values in column A below row 24, one method you could try:
@halfglassdarkly thanks for the reply. The alternative solution doesn't work as the table gets updated with new row every week. The table range idea is good but I prefer not to do this as this excel file is maintained by few managers who like to keep it that way. Are there any options in power bi query editor for this situation? Thanks
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
68 | |
53 | |
39 | |
33 |
User | Count |
---|---|
70 | |
63 | |
57 | |
49 | |
46 |