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

Win a FREE 3 Day Ticket to FabCon Vienna. Apply now

Reply
ThreeChanges
New Member

Query Top N from Azure Table

Hi,

 

I am trying to get only the Top N entries from an Azure Table. Loading all hundres of GB would take hours and crash PowerBI, so I need to limit the results. Also, doing a filter on the timestamp is super slow.

 

I tried Table.FirstN, but it seems to load all entries from the table and then only take the first N in memory. I am looking for something similar to the Azure Table REST query param: https://myaccount.table.core.windows.net/Customers()?$top=10 (from https://docs.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities)

 

Is there a way to do this in Power BI?

 

My query looks like this:

let
Source = AzureStorage.Tables("azuretableurl"),
monitorlogs1 = Source{[Name="tablename"]}[Data],
filteredLogs1 = Table.SelectRows(monitorlogs1, each [PartitionKey] = "mail"),
topLogs1 = Table.FirstN(filteredLogs1, 100000),
#"Expanded Content" = Table.ExpandRecordColumn(topLogs1, "Content", {"AvgSetDuration", "AvgGetDuration", "AvgDeleteDuration", "AvgResponse", "AvgMailSchedule", "StuckMails"}, {"Content.AvgSetDuration", "Content.AvgGetDuration", "Content.AvgDeleteDuration", "Content.AvgResponse", "Content.AvgMailSchedule", "Content.StuckMails"}),
#"Renamed Columns" = Table.RenameColumns(#"Expanded Content",{{"Content.AvgMailSchedule", "MailSchedule"}, {"Content.StuckMails", "StuckMails"}})
in
#"Renamed Columns"

1 REPLY 1
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @ThreeChanges,

 

I don't think there is a better solution here in this scenario currently. Here is a similar idea about filtering azure table storage from the URL share on Power BI Ideas for your reference. You can vote it up and add your comments there to improve Power BI on this feature. Smiley Happy

 

Regards

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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