Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
let
ColumnNames = Table.ColumnNames(DatabaseRecords(num)),
Tabled_Column_Data = ConvertToTable_SubTable(Table.Column(DatabaseRecords(num), ColumnNames{1})),
objects = #table(
{"Name", "Key", "Data", "ItemKind", "ItemName", "IsLeaf"},{
{ColumnNames{0}, ColumnNames{0}, ConvertToTable_SubTable(Table.Column(DatabaseRecords(num), ColumnNames{0})), "Table", "Table", true},
{ColumnNames{1}, ColumnNames{1}, ConvertToTable_SubTable(Table.Column(DatabaseRecords(num), ColumnNames{1})), "Table", "Table", true},
{ColumnNames{2}, ColumnNames{2}, ConvertToTable_SubTable(Table.Column(DatabaseRecords(num), ColumnNames{2})), "Table", "Table", true},
{ColumnNames{3}, ColumnNames{3}, ConvertToTable_SubTable(Table.Column(DatabaseRecords(num), ColumnNames{3})), "Table", "Table", true},
{ColumnNames{4}, ColumnNames{4}, ConvertToTable_SubTable(Table.Column(DatabaseRecords(num), ColumnNames{4})), "Table", "Table", true}
}),
NavTable = Table.ToNavigationTable(objects, {"Key"}, "Name", "Data", "ItemKind", "ItemName", "IsLeaf")I am using this to create 5 items on a navigation table. I want a if statement for the last one aka 4th that checks t see if ColumnNames{4} is null, if it is then don't add it to the objects table. Is this possible?
I think you can try Table.RowCount function in your M query. If count not blank row equal to 0, then return null.
Here I find a offical blog about Handling Navigation, I hope it could help you solve your problem.
For reference: Handling Navigation
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |