Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Can anyone assist? 😔
I've been migrating to Power BI Service and have been stuck on this issue for two weeks.
Everything looks fine in preview, no yellow warnings but, when I load it into the report the same error keeps appearing.
The error that i encounter is repeating which is :
Underlying Error Query Evaluation failed for query: 1_TenPlan - RDC_Fab (Unit)
and this is my Query:
Hi @Klik,
Checking in to see if your issue has been resolved. let us know if you still need any assistance.
Thank you.
The error happens because Table.RemoveLastN (and similar row removal steps) fails in Power BI Service when the Excel sheet has fewer rows than expected after filtering/skipping. Preview works since your local file matches expectations, but the latest SharePoint file likely has different row count.
Replace the failing steps with safer versions:
This checks row count before removing.
Add Table.Buffer(Extracted) right after the Extracted step to lock data in memory and prevent folding issues during service refresh. Also verify the latest ENGINEERING.xlsx file on SharePoint has the expected "Dashboard"/"DASHBOARD" sheet with enough rows (>7 total after skips). Test by manually refreshing each step in Power Query Editor.
Hi @Klik,
Have you had a chance to review the solution we shared earlier? If the issue persists, feel free to reply so we can help further.
Thank you.
you can make your error handling more robust
Extracted = if Table.IsEmpty(FilteredSheet) then #table({}, {}) else FilteredSheet{0}[Data],
or
Extracted =
if Table.IsEmpty(FilteredSheet) then
#table(type table [], {})
else
try FilteredSheet{0}[Data] otherwise #table(type table [], {})
This ensures that if the workbook changes or is missing the “Dashboard” sheet, it returns a blank table instead of crashing.
Still the same error popping Sir 🙏
Hi @Klik,
Please try the updated M-Query Below
let
Source = SharePoint.Contents("https://miscbhd.sharepoint.com/sites/xxxx", [ApiVersion = 15]),
Library = Source{[Name="Shared Documents"]}[Content],
FilteredFiles = Table.SelectRows(Library, each Text.Contains([Name], "ENGINEERING") and Text.EndsWith([Name], ".xlsx")),
SortedFiles = Table.Sort(FilteredFiles, {{"Date modified", Order.Descending}}),
LatestFile = Table.FirstN(SortedFiles, 1),
Binary = LatestFile{0}[Content],
ExcelContent = Excel.Workbook(Binary, false),
PossibleNames = {"Dashboard", "DASHBOARD"},
FilteredSheet = Table.SelectRows(ExcelContent, each List.Contains(PossibleNames, [Name])),
Extracted = if Table.IsEmpty(FilteredSheet) then #table({}, {}) else FilteredSheet{0}[Data],
#"Removed Top Rows" = Table.Skip(Extracted, 4),
#"Removed Other Columns" = Table.SelectColumns(#"Removed Top Rows", {
"Column1", "Column2", "Column3", "Column4", "Column5",
"Column6", "Column7", "Column8", "Column9", "Column10",
"Column11", "Column12", "Column13", "Column14"
}),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Other Columns", [PromoteAllScalars = true]),
#"Removed Top Rows1" = Table.Skip(#"Promoted Headers", 1),
#"Removed Bottom Rows" = Table.RemoveLastN(#"Removed Top Rows1", 2),
#"Renamed Columns" = Table.RenameColumns(#"Removed Bottom Rows", {
{"%#(lf)PLAN ", "PLAN"},
{"%#(lf)ACTUAL ", "ACTUAL"},
{"%#(lf)VAR. ", "VAR"},
{"%#(lf)BAL.", "BAL"},
{"TOTAL", "TOTAL"}
}, MissingField.Ignore),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns", {
{"TOTAL", Int64.Type},
{"PLAN", Percentage.Type},
{"ACTUAL", Percentage.Type},
{"VAR", Percentage.Type},
{"BAL", Percentage.Type}
})
in
#"Changed Type"
Thank you.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |